473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

121 100+
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
2 1455
Shashi Sadasivan
1,435 Expert 1GB
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
jay123
121 100+
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

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

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: Surjeet Gill | last post by:
I was getting the following error after compiling the C# source file with VS.NET 2003, Any help will be appreciated. Many thanks! Surjeet Gill Details: Compilation Error Description: An...
1
by: Venki | last post by:
I have a textbox to enter an email address followed by a telephone textbox. The email has a regularexpressionvalidator and a requiredfieldvalidator. The ReqField works fine, but if I put in an...
12
by: Raed Sawalha | last post by:
I have the following table which i can not switcha to design view error message said Could not open in Design view. Quote values differently inside a '<% ...."value"... %>' block. and the...
3
by: Eagle | last post by:
First I tried using the try, catch, throw, but it errored on the throw and I don't want it to stop there, I want it to stop in the frm, not the class. Next I set a Session to catch the error, and...
4
by: louise raisbeck | last post by:
HI there, I am using a Try catch statement and I can return the Exception.Message fine..but i want to catch a particular SQL error 1205 (locking). How do I say : catch (System.Exception ex)...
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
25
by: JJ | last post by:
I only want to catch 404 errors at the application level (the rest are will be handled by the customerrors section of the web.config). How do I check for the error code in the Application_Error...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.