Tips and tricks: use ASP. NET ajax to handle updatepanel control errors

Source: Internet
Author: User

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.