Asp. NET use of UpdatePanel when using the response output error resolution method

Source: Internet
Author: User

Execute to Response.Write ("XX") in ASP. or Microsoft JScript run-time error: Sys.WebForms.PageRequestManagerParserErrorException : The message received from the server could not be parsed. The common reason for this error is that response filters, HttpModule, or server traces are enabled when you modify the response by calling Response.Write ().
When UpdatePanel is placed, first add to </UpdatePanel> before
<triggers><asp:asyncpostbacktrigger controlid= "Timer1"/></triggers> try, if it is set up Postbacktrigger It is not possible to Response.Write (); Normally, Microsoft recommends that we use this:
String scripts = "<script>alert (' pop-up prompt box! ');</script> ";
ClientScriptManager CSM = page.clientscript;
CSM. RegisterClientScriptBlock (this. GetType (), "SSS", scripts, false);
//CSM. RegisterStartupScript (this. GetType (), "SSS", scripts,false);
If it doesn't work, you can use it specifically for the UpdatePanel control:
Scriptmanager.registerstartupscript (this. UpdatePanel1, this. GetType (), "Updatescript", "alert (' Not logged in!") '); ", true);
All you need to do is alert (' Not logged in! Change to the script you want to output!

Reference: http://wangyali90516.blog.163.com/blog/static/117205101201083025730557/

Asp. NET use of UpdatePanel when using the response output error resolution method

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.