Scriptmanager is used to process all Ajax components and partial page updates on the page and generate related client scripts. All pages that need to support Ajax have only one scriptmanager control.
In the traditional post back mode, the entire page will be re-painted when the user submit, and the browser will flash explicitly. In the Ajax framework, you can use the updatepanel label to specify the part to be repainted. In this way, the page will first judge whether the page is in repainting mode based on the scriptmanager. isinpartialrenderingmode attribute when processing the request. In the redrawing mode, only the updatepanel content to be repainted is returned to the client browser, and the Ajax engine automatically updates the content. In this mode, users can enjoy the enhancement of the client user experience brought about by Ajax.
To add asynchronous effects to the source program without script errors, You need to modify some of the source programs.
Source code |
Change |
Shape Page. clientscript. registerstartupscript (this. GetType (), "", "<SCRIPT> alert ('select the family to be merged first! ') </SCRIPT> "); |
Scriptmanager. registerclientscriptblock (this, this. GetType (), "", "alert ('select the family to be merged first! ') ", True ); |
Server. Transfer jump |
Response. Redirect |