I am making a web request to a site & all is working fine. But today i found that the site url isnt working. Site is unavailable due to some reasons. So then in my code i am getting error of "Unable to connect to remote server". My code is as follows.
private WebRequest _request;
_request = WebRequest.Create(uri[j]); // uri[j] is an array containing site url
_request.Method = "POST";
_request.ContentType = "application/x-www-form-urlencoded";
_request.ContentLength = buffer.Length;
PostData = _request.GetRequestStream(); <---- gives error
PostData.Write(buffer, 0, buffer.Length);
How can i catch this exception? Is there some way to catch such exception??? Thnx in advance..
I want to add Hit counter to my site. I found few ways to do it:
1. Free hit counters - Problem is it adds site's links/signature.
2. Hit counter using file based storage - File can be crashed when lots of concurrent hits.
3. Database hit counter - Slowdowns the page load.
What is best way to implement it. It's my intranet company site where I need to do it.
Well, the header you used was ridiculous, the code sucks in all sorts of ways - how about telling us what the code is supposed to do. I doubt it's even ASP.NET code, I've never seen anyone silly enough to do a postback on a key press.
Why is it that no-one on this site knows what ASP.NET is ?
You can scan a document, externally to your ASP.NET website, and then use ASP.NET to submit that document to your server. Then you can buy an OCR component if you want to use OCR to extract the text. ASP.NET has almost nothing to do with any step of this process.
in one of my application i am using mscomm32.ocx for fetching data from electronic weighbridge but in this case one problem occur some time it gives wrong value(eg:the actual weight is 5900Kg some time it shows 2810Kg or 2800Kg and then again convert to 5900Kg automatically it happens frequently in some timer interval).i am using timer control for getting data to textbox.
I´m developing a ASP.NET WEB application in Visual Studio 2008 (C#).
I'm trying to insert a standar control from the toolbox so I drag it (the control) from the toolbox to the design window. It doesn't works !!!
When I drag a HTML control from the toolbox it works but I need a standar control.