Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    API(s)
    Sencha-Touch
    Single Page App
    Bootstrap
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> AJAX >> ASP.Net AJAX Server Control: UpdateProgress, UpdatePanel
ASP.Net AJAX Server Control: UpdateProgress, UpdatePanel
ASP.Net AJAX Server Control: UpdateProgress, UpdatePanel


by Amit Singh on 10/9/2010 8:34:38 PM

Views: 6232       Comments: 0

ASP.Net AJAX Server Control: UpdateProgress, UpdatePanel

UpdateProgress: A control that allows you to display a visual element to the end user to show that a partial page post back is occurring to the part of the page making the update. This is an ideal control to use when you have long running AJAX update.

UpdatePanel: A Container Control that allows you to define specific areas of the page that are enabled with script manager. It contains two sections:

One is <Content Template> and another is <Triggers> section                                                                                  

How we implement the Update Progress server control

 

Example:

Step1: we use the following control on aspx page

 

<head runat="server">

<title>Using Update Panel</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<%--Using script Manager Control--%>

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<%--Using UpdateProgress Control--%>

<asp:UpdateProgress ID="UpdateProgress1" runat="server">

<ProgressTemplate>

Update is showing here.......

</ProgressTemplate>

</asp:UpdateProgress>

<%--Using UpdatePanel Here--%>

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

<ContentTemplate>

<%--Adding one button outside the update panel--%>

<asp:Label ID="lblShowDate" runat="server" Text=""></asp:Label>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTrigger ControlID="btnShowDate" EventName="Click" />

</Triggers>

</asp:UpdatePanel>

<br /><br />

<%--Adding one button outside the update panel--%>

<asp:Button ID="btnShowDate" runat="server" Text="Show Date" OnClick="btnShowDate_Click" />

</div>

</form>

</body>

 

 

 

Step2: We write the following code on button click event.

 

protected void btnShowDate_Click(object sender, EventArgs e)

{

   System.Threading.Thread.Sleep(TimeSpan.Parse("00:00:10"));

   lblShowDate.Text = "Today Date is: " + DateTime.Now.ToString();

}

 

Step3: Run the project

 

After 10 second, the output is:

 

 

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by Amit SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 3365
Advertisement
MindStick Cleaner
Advertise with Us
  
Copyright © 2009 - 2014MindStick. All Rights Reserved.