ASP.NET – Ajax Control

ASP.NET – Ajax Control

Posted on

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.

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

The syntax for the UpdateProgress control is:

<asp:UpdateProgress ID=”UpdateProgress1″

runat=”server”

DynamicLayout=”true”

AssociatedUpdatePanelID=”UpdatePanel1″ >

<ProgressTemplate>

Loading…

</ProgressTemplate>

</asp:UpdateProgress>

The above snippet shows a simple message within the ProgressTemplate tag, however it could be an image or other relevant controls. The UpdateProgress control will display for every asynchronous postback unless it is assigned to a single update panel using the AssociatedUpdatePanelID property.

Properties of the UpdateProgress Control

The following table shows the properties of the update progress control:

Properties

Description

AssociatedUpdatePanelID

Gets and sets the ID of the update panel with which this control is associated.

Attributes

Gets or sets the cascading style sheet (CSS) attributes of the UpdateProgress control.

DisplayAfter

Gets and sets the time in milliseconds after which the progress template is displayed. The default is 500.

DynamicLayout

Indicates whether the progress template is dynamically rendered.

ProgressTemplate

Indicates the template displayed during an asynchronous post back which takes more time than the DisplayAfter time.

Methods of the UpdateProgress Control

The following table shows the methods of the update progress control:

The Timer Control:

The timer control is used to initiate the post back automatically. This could be done in two ways:

(1) Setting the Triggers property of the UpdatePanel control:

<Triggers>

<asp:AsyncPostBackTrigger

ControlID=”btnpanel2″

EventName=”Click” />

</Triggers>

(2) Placing a timer control directly inside the UpdatePanel to act as a child control trigger. A single timer can be the trigger for multiple UpdatePanels.

<asp:UpdatePanel ID=”UpdatePanel1″

runat=”server”

UpdateMode=”Always”>

<ContentTemplate>

<asp:Timer ID=”Timer1″ runat=”server” Interval=”1000″>

</asp:Timer>

<asp:Label ID=”Label1″ runat=”server”

Height=”101px” style=”width:304px”>

</asp:Label>

</ContentTemplate>

</asp:UpdatePanel>

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

ASP.NET – Ajax Control

Posted on Updated on

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.

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

The syntax for the UpdateProgress control is:

<asp:UpdateProgress ID=”UpdateProgress1″

runat=”server”

DynamicLayout=”true”

AssociatedUpdatePanelID=”UpdatePanel1″ >

<ProgressTemplate>

Loading…

</ProgressTemplate>

</asp:UpdateProgress>

The above snippet shows a simple message within the ProgressTemplate tag, however it could be an image or other relevant controls. The UpdateProgress control will display for every asynchronous postback unless it is assigned to a single update panel using the AssociatedUpdatePanelID property.

Properties of the UpdateProgress Control

The following table shows the properties of the update progress control:

Properties Description
AssociatedUpdatePanelID Gets and sets the ID of the update panel with which this control is associated.
Attributes Gets or sets the cascading style sheet (CSS) attributes of the UpdateProgress control.
DisplayAfter Gets and sets the time in milliseconds after which the progress template is displayed. The default is 500.
DynamicLayout Indicates whether the progress template is dynamically rendered.
ProgressTemplate Indicates the template displayed during an asynchronous post back which takes more time than the DisplayAfter time.

Methods of the UpdateProgress Control

The following table shows the methods of the update progress control:

Methods Description
GetScriptDescriptors Returns a list of components, behaviors, and client controls that are required for the UpdateProgress control’s client functionality.
GetScriptReferences Returns a list of client script library dependencies for the UpdateProgress control.

The Timer Control:

The timer control is used to initiate the post back automatically. This could be done in two ways:

(1) Setting the Triggers property of the UpdatePanel control:

<Triggers>

<asp:AsyncPostBackTrigger

ControlID=”btnpanel2″

EventName=”Click” />

</Triggers>

(2) Placing a timer control directly inside the UpdatePanel to act as a child control trigger. A single timer can be the trigger for multiple UpdatePanels.

<asp:UpdatePanel ID=”UpdatePanel1″

runat=”server”

UpdateMode=”Always”>

<ContentTemplate>

<asp:Timer ID=”Timer1″ runat=”server” Interval=”1000″>

</asp:Timer>

<asp:Label ID=”Label1″ runat=”server”

Height=”101px” style=”width:304px”>

</asp:Label>

</ContentTemplate>

</asp:UpdatePanel>

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com