Basic Controls of ASP.NET AJAX
There are some ASP.NET Web server controls that enable you to add Ajax functionality to an ASP.NET Web page. Ajax functionality includes re-rendering parts of a page with a partial-page update and therefore avoiding a full-page postback.
These controls are ScriptManager, ScriptManagerProxy, Timer, Update Panel and Update Progress.
ScriptManager
When it is used.?
1. Whenever we want client-script functionality of the Microsoft Ajax Library and any custom script that we want to send to the browser.
2. While partial-page rendering which enables regions on the page to be independently refreshed without a postback. The ASP.NET UpdatePanel, UpdateProgress and Timer Controls require a ScriptManager in order to support partial-page rendering.
3. When we want client script to access Web services and specially marked methods in ASP.NET pages, it needs to enable JavaScript proxy classes for Web services.
4. To access ASP.NET authentication, profile and roles application services, JavaScript Classes is needed and must be enabled by ScriptManager.
ScriptManager enables client-script functionality, partial-page rendering, JavaScript proxy classes and JavaScript Classes on a page.
When a page contains one or more UpdatePanel controls, the ScriptManager control manages partial-page rendering in the browser. The control interacts with the page life cycle to update the parts of the page that are inside UpdatePanel controls. The EnablePartialRendering property of the ScriptManager control determines whether a page participates in partial-page updates. By default, the EnablePartialRendering property is true. Therefore, by default partial-page rendering is enabled when you add a ScriptManager control to the page.
ScriptManagerProxy
Only one instance of the ScriptManager control can be added to the page. The page can include the control directly or indirectly inside a nested component such as a user control, content page for a master page, or nested master page. If a page already contains a ScriptManager control, but a nested or parent component needs additional features of the ScriptManager control, the component can include a ScriptManagerProxy control.
Timer
To avoid the refreshing whole page and to refresh only some region of page or content of UpdatePanel, a timer control is used for this purpose.
UpdatePanel
UpdatePanel control is used to create rich, dynamic and client-centric Web applications. By using UpdatePanel control, we can refresh selected parts of the page instead of refreshing the whole page with a postback.This is called as partial page update. An ASP.NET Web page that contains a ScriptManager control and one or more UpdatePanel controls can automatically participate in partial-page updates, without custom client script. When we use an UpdatePanel control, the page behavior becomes browser independent and can potentially reduce the amount of data that is transferred between client and server.
There are some ASP.NET Web server controls that enable you to add Ajax functionality to an ASP.NET Web page. Ajax functionality includes re-rendering parts of a page with a partial-page update and therefore avoiding a full-page postback.
These controls are ScriptManager, ScriptManagerProxy, Timer, Update Panel and Update Progress.
ScriptManager
When it is used.?
1. Whenever we want client-script functionality of the Microsoft Ajax Library and any custom script that we want to send to the browser.
2. While partial-page rendering which enables regions on the page to be independently refreshed without a postback. The ASP.NET UpdatePanel, UpdateProgress and Timer Controls require a ScriptManager in order to support partial-page rendering.
3. When we want client script to access Web services and specially marked methods in ASP.NET pages, it needs to enable JavaScript proxy classes for Web services.
4. To access ASP.NET authentication, profile and roles application services, JavaScript Classes is needed and must be enabled by ScriptManager.
ScriptManager enables client-script functionality, partial-page rendering, JavaScript proxy classes and JavaScript Classes on a page.
When a page contains one or more UpdatePanel controls, the ScriptManager control manages partial-page rendering in the browser. The control interacts with the page life cycle to update the parts of the page that are inside UpdatePanel controls. The EnablePartialRendering property of the ScriptManager control determines whether a page participates in partial-page updates. By default, the EnablePartialRendering property is true. Therefore, by default partial-page rendering is enabled when you add a ScriptManager control to the page.
ScriptManagerProxy
Only one instance of the ScriptManager control can be added to the page. The page can include the control directly or indirectly inside a nested component such as a user control, content page for a master page, or nested master page. If a page already contains a ScriptManager control, but a nested or parent component needs additional features of the ScriptManager control, the component can include a ScriptManagerProxy control.
Timer
To avoid the refreshing whole page and to refresh only some region of page or content of UpdatePanel, a timer control is used for this purpose.
UpdatePanel
UpdatePanel control is used to create rich, dynamic and client-centric Web applications. By using UpdatePanel control, we can refresh selected parts of the page instead of refreshing the whole page with a postback.This is called as partial page update. An ASP.NET Web page that contains a ScriptManager control and one or more UpdatePanel controls can automatically participate in partial-page updates, without custom client script. When we use an UpdatePanel control, the page behavior becomes browser independent and can potentially reduce the amount of data that is transferred between client and server.
No comments:
Post a Comment