By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

catching particular error and display error in label instead of microsoft error page.

100+
P: 121
Hello,
I am making a project in VS2008, C#.
Background of prob:
I have integrated a postcode(UK- its like if someone enters postcode and clicks button to retrieve the address, he gets all the addresses at that postcode(or street in indian language) web service, now the problem is as we go to our client with all of our project in laptop and while giving demo if we click on button we get an error saying :

The request failed with HTTP status 417: Exception failed

Now I know the solution when we have internet connection( just uncheck proxy server in connection and check the server option in) but what I want is when I run this on my laptop instead of getting a filthy error, I should get some msg saying u donít have internet connection( just on some label on that page)

Short words: I want to catch that particular error and display some error in label on that very page so that I can be done manually.

Any help with code will be appreciated.
Thanks in advance
Sep 5 '08 #1
Share this Question
Share on Google+
2 Replies


Shashi Sadasivan
Expert 100+
P: 1,435
Have you tried using the try catch around the code which calls the webservice.
If the code enters the catch block, then use it to update your label. !!

The other solution could be to create a custom error page for that errror code you get describing what could cause that error, and what can be done to fix it
Sep 5 '08 #2

100+
P: 121
Have you tried using the try catch around the code which calls the webservice.
If the code enters the catch block, then use it to update your label. !!

The other solution could be to create a custom error page for that errror code you get describing what could cause that error, and what can be done to fix it
thanks shashi,
i did solve the problem before but using the same way u suggested.
Sep 11 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.