[Original address] tip/TRICK: handling errors with the updatepanel Control Using ASP. NET Ajax
[Original article published on] Sunday, October 29,200
Luis Abreu is an ASP. net mvp and has a wonderful blog on the http://msmvps.com blog site. Earlier today, he posted a wonderful tutorial post describing how to use ASP. net Ajax beta1 to add more robust (robust) error handling to your application. I strongly recommend you read it and add it to favorites for future use.
In the Ajax world, it is often quite tricky to handle errors, especially when Ajax callback is in progress and the client-side and server-side codes of the application are mixed to run. In the latest version, the <asp: updatepanel> Control in ASP. NET Ajax now has more robust error handling and error reporting features for you. Specifically,
1) You can now process the onasyncpostbackerror event on the <asp: scriptmanager> Control to capture and/or modify the error messages that occur when the server processes the Ajax PostBack callback.
2) Now you can set the allowcustomerrors attribute on the <asp: scriptmanager> Control to start standard ASP.. Net custom error support. When the error is reversed, you can automatically redirect the user to an error page even if the error occurs in Ajax PostBack.
3) You can also choose to process the Javascript events of the client on the page to intercept any error messages sent back from the server to execute custom client behavior. For example, instead of jumping out of a message dialog box, the error message is output to a nice <div> area.
Read the Luis tutorials to learn how to use these new features.
I hope this article will help you,
Scott
Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 1365089