Tuesday, May 15, 2012

Why we Use the ScriptManager Control in asp.net



The ScriptManager control manages client script for Microsoft ASP.NET AJAX pages. By default, the ScriptManager control registers the script for the Microsoft AJAX Library with the page. This enables client script to use the type system extensions and to support features such as partial-page rendering and Web-service calls.

we must use a ScriptManager control on a page to enable the following features of ASP.NET AJAX: Client-script functionality of the Microsoft AJAX Library, and any custom script that we want to send to the browser. Partial-page rendering, which enables regions on the page to be independently refreshed without a postback. The ASP.NET AJAX UpdatePanel, UpdateProgress, and Timer controls require a ScriptManager control to support partial-page rendering. JavaScript proxy classes for Web services, which enable we to use client script to access Web services by exposing Web services as strongly typed objects. JavaScript classes to access ASP.NET authentication and profile application services.

ScriptManager is a parent control that should be used on every page where we want to use other controls of the ASP.net AJAX. A standard code for ScriptManager control will look like following:
 
<asp:ScriptManager ID="scriptmgr1" runat="Server" EnablePartialRendering="True" />


Can we use multiple ScriptManager on a page?
No. We can use only one ScriptManager on a page.


About the UpdatePanel:
The UpdatePanel enables you to add AJAX functionality to existing ASP.NET applications. It can be used to update content in a page by using Partial-page rendering. By using Partial-page rendering, you can refresh only a selected part of the page instead of refreshing the whole page with a postback.


The UpdatePanel has two child tags
one is ContentTemplate and another is Triggers

No comments:

Post a Comment

Comments

Search

Custom Search
Protected by Copyscape Plagiarism Software