The ScriptManager control is included in the ASP.net 2.0 AJAX extensions, which is used to process all components on the page as well as page local updates, generating related client-side proxy scripts to enable access to Web Service in JavaScript, There can be only one ScriptManager control on asp.net pages that need to support asp.net ajax. In the ScriptManager control we can specify the desired script library, or specify the Web Service to be invoked through JS, and call AuthenticationService and ProfileService, as well as page error handling.
A Control Overview
The ScriptManager control is included in the ASP.net 2.0 AJAX extensions, which is used to process all components on the page as well as page local updates, generating related client-side proxy scripts to enable access to Web Service in JavaScript, There can be only one ScriptManager control on asp.net pages that need to support asp.net ajax. In the ScriptManager control we can specify the desired script library, or specify a Web Service to be invoked through JS, and specify page error handling.
Use <asp:ScriptManager/> to define a ScriptManager, simple ScriptManager definition form:
<asp:ScriptManager ID="ScriptManager1"
runat="server">
<AuthenticationService Path="" />
<ProfileService LoadProperties="" Path="" />
<Scripts>
<asp:ScriptReference/>
</Scripts>
<Services>
<asp:ServiceReference />
</Services>
</asp:ScriptManager>
The ScriptManager properties and methods are as follows:
Properties/Methods |
Describe |
Allowcustomerror |
Contact the custom error configuration area <customErrors> in web.config, use it, and the default value is True |
Asyncpostbackerrormessage |
A custom prompt error message when an error occurs in an asynchronous postback. |
Asyncpostbacktimeout |
Timeout limit for asynchronous postbacks, with a default value of 90, in seconds |
EnablePartialRendering |
Whether local updates to the page are supported, the default value is true, and generally do not need to be modified |
ScriptMode |
Specifies the mode of the script that ScriptManager sends to the client, with four modes: Auto,inherit,debug,release, the default value is Auto, and the following will be said carefully. |
ScriptPath |
Sets the root directory of all script blocks as global properties, including custom script blocks or script blocks referencing third parties. If the Path property is set in the <asp:ScriptReference/> tab in scripts, it overrides the property. |
Onasyncpostbackerror |
The service-side processing function When an exception occurs asynchronously, where a piece of information can be captured and processed accordingly. |
Onresolvescriptreference |
Specifies the server-side processing function of the Resolvescriptreference event, in which you can modify information about a script, such as the path, version, and so on. |