Showing posts with label catch. Show all posts
Showing posts with label catch. Show all posts

Saturday, March 24, 2012

Exception not being sent

Hi there!
I'm having a little bit of trouble trying to catch exceptions thrown by the application.
I inserted the scriptmanager tag inside the head tag:
<atlas:ScriptManager ID="scriptManager" runat="server">
<Services>
<atlas:ServiceReference Path="ChatService.asmx" />
</Services>
</atlas:ScriptManager>
I've already tried to put the GenerateProxy = "true" property and still doesn't work...
when I call a webmethod, I do something like:

ClassName.WebMethod(attributes, onCallOk, onTimeout, onError);

the functions are inside a .js file.

The darkiest thing is that when the error occurs on my machine I cansee the message from the exception, but, when someone from anothermachine (acessing my machine) receives the error, the message from theexception is sent empty, even when the same occurs...

is there something that I have to do to allow remote computers to receive the exception?

thanks!!!

hi leandrokoiti,

you can have a look at Nikhil blog:

http://www.nikhilk.net/AtlasM1Refresh.aspx

they talk about that subjet

Exception Handling

Code within my Update Pannel is throwing an exception. This is by design. Lets assume that I trap the exception within a catch statement. Is there any way that I can display a message to a user via a Label control that is outside of my Update Pannel? Maybe this is not specific to exception handling... What if I need to update a control / display item that falls outside of my Update Pannel? Is there any way to cancel the partial update? Even force a full postback of the page?

Thanks,

I think following blog exactly fit your requirements.

http://msmvps.com/blogs/luisabreu/archive/2006/10/29/UpdatePanel_3A00_-having-fun-with-errors.aspx

Wednesday, March 21, 2012

Event to catch unavailable database with CascadingDropDown

I have the CascadingDropDown control working correctly with 2 DropDownLists. They're both being used with a database and I want to be able to catch any database errors (for example an unavailable db) before the DropDownLists display the dreaded [Method error 500]. From there I can hide the form panel and display a panel with a friendly error message. How would I go about doing that? With an ObjectDataSource I could catch it during the OnSelected event...

I haven't used the CascadingDropDown control but I assume it using the standard ASP.Net Ajax Library for async. calls. So se if the following way of handling exceptions in ASP.Net Ajax will work for you:

http://fredrik.nsquared2.com/viewpost.aspx?PostID=396&showfeedback=true

http://fredrik.nsquared2.com/viewpost.aspx?PostID=395&showfeedback=true

http://fredrik.nsquared2.com/viewpost.aspx?PostID=394&showfeedback=true


Fredrik

This doesn't seem to be working for me... I don't know if the CascadingDropDown behaves differently than the the UpdatePanel or if there's a problem with my configuration. I followed your examples and still receive the error as an item within the dropdown box on the page rather than an alertbox. I also attempted to change the innerHTML of a label using the PageRequestManager to no avail. Otherwise, very good articles that should come in handy with other AJAX controls.