ASP.NET AJAX

ASP.NET AJAX :

AJAX stands forAsynchronous JavaScript and XML. This is a cross platform technology which speeds up response time. The AJAX server controls add script to the page which is executed and processed by the browser.

ASP.NET AJAX Controls :

ScriptManager control  : Manages client script for AJAX-enabled ASP.NET web pages.

ScriptManager Proxy control:   Enables nested components such as content pages and user controls to add script and service references to pages when a ScriptManager control is already defined in a parent element.

Timer control :   Performs postbacks at defined intervals. If you use the Timer control with an UpdatePanel control, you can enable partial-page updates at a defined interval. You can also use the Timer control to post the whole page.

UpdatePanel control:   Enables you to build rich, client-centric web applications. By using UpdatePanel controls, you can perform a partial-page update.

UpdateProgress control :  Provides status information about partial-page updates in UpdatePanel controls.

The ScriptManager Control :

The ScriptManager control is the most important control and must be present on the page for other controls to work.

Syntax for ScriptManager Control

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
If you create an 'Ajax Enabled site' or add an 'AJAXWeb Form' from the 'Add Item' dialog box, the web form automatically contains the script manager control. The ScriptManager control takes care of the client-side script for all the server side controls.

The UpdatePanel Control:

The UpdatePanel control is a container control and derives from the Control class. It acts as a container for the child controls within it and does not have its own interface. When a control inside it triggers a post back, the UpdatePanel intervenes to initiate the post asynchronously and update just that portion of the page.

Syntax for update panel control:

   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  </asp:UpdatePanel>

For example, if a button control is inside the update panel and it is clicked, only the controls within the update panel will be affected, the controls on the other parts of the page will not be affected. This is called the partial post back or the asynchronous post back.

The UpdateProgress Control :

The UpdateProgress control provides a sort of feedback on the browser while one or more update panel controls are being updated. For example, while a user logs in or waits for server response while performing some database oriented job.

Syntax for Update Progress Control

<asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanel1" >
   <ProgressTemplate>
      Loading...
   </ProgressTemplate>
   </asp:UpdateProgress>

It provides a visual acknowledgement like "Loading page...", indicating the work is in progress.

Timer Control :

In Ajax Extensions the timer control is used to initiate the post back automatically. The Two ways of timer Control is
Syntax for Timer Control
 <Triggers>
 <asp:AsyncPostBackTrigger ControlID="btnpanel2" EventName="Click" />
 </Triggers>

  1. Setting the Triggers property of the Update Panel control:
  2. Placing a timer control directly inside the Update Panel to act as a child control trigger.
Reference :




Comments

Popular posts from this blog

Top25 ASP.NET Interview Questions - FAQ | Crack the Interview Easily

The Future of .NET Developement

Top 5 Features of Entity Framework Version 7 Every Dot Net Developers Should Know