Solve the Problem of ASP. net ajax script errors

Source: Internet
Author: User

1. screen migration should use the Response that executes screen redirection. redirect instead of Server. transfer, because Server. transfer does not change the IE client URL, which causes ASP. a URL error occurs when the. net ajax script accesses the resource.

2. the ScriptManager class should be used to register scripts and hidden fields on the server, instead of pages. clientScript object, because Page. the ClientScript method is to register the script to a global object, which will cause local update, these scripts will not be sent to the client, and the ScriptManager method is the opposite. The ScriptManager class can be used no matter whether there is a ScriptManager control on the screen.

3. put both the event source control and the control to be updated to UpdatePanel. If only the updated control is placed in UpdatePanel, the event source control triggers a send-back event to refresh the screen, just like the UpdatePanel control.

4. Add the hidden fields and controls involved in the update to UpdatePanel. If the hidden field is not placed in UpdatePanel, its value cannot be modified during update. Similarly, the hidden control to be operated cannot be operated in UpdatePanel.

5. ASP. net ajax script method should be executed after the ScriptManager label, because the place where the ScriptManager is placed is embedded with ASP. net ajax script library, which means that the code before this cannot access the script library method.

6. Handle Sys. WebForms exceptions because these exceptions may lead to errors that are hard to understand and should be blocked when necessary.

  1. Implementation of ASP. NET plug-in
  2. Overview ASP. NET Applications
  3. Introduction to ASP. NET 2.0 Data Binding
  4. ASP. NET prevents Java Script Injection attacks
  5. ASP. net mvc using T4

Related Article

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.