Ajax ProgressTemplate – How to use Progress Template in asp.net Ajax Update Progress




- <%@ Page Language=“C#” %>
- <%@ Import Namespace=“System.Drawing” %>
- <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
- <script runat=“server”>
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- BulletedList1.Width = 500;
- BulletedList1.BackColor = Color.AliceBlue;
- BulletedList1.Font.Bold = true;
- BulletedList1.Font.Size = FontUnit.Medium;
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- System.Threading.Thread.Sleep(5000);
- BulletedList1.Items.Add(DateTime.Now.ToLongTimeString());
- }
- </script>
- <html xmlns=“http://www.w3.org/1999/xhtml” >
- <head id=“Head1″ runat=“server”>
- <title>Ajax ProgressTemplate - How to use ProgressTemplate in asp.net ajax UpdateProgress</title>
- </head>
- <body>
- <form id=“form1″ runat=“server”>
- <div>
- <h2 style=“color:DarkBlue; font-style:italic;”>Ajax UpdateProgress Example: Using ProgressTemplate</h2>
- <hr width=“550″ align=“left” color=“LightBlue” />
- <asp:ScriptManager
- ID=“ScriptManager1″
- runat=“server”
- >
- </asp:ScriptManager>
- <asp:UpdateProgress ID=“UpdateProgress1″ runat=“server”>
- <ProgressTemplate>
- <asp:Label
- ID=“Label1″
- runat=“server”
- ForeColor=“OrangeRed”
- Font-Bold=“true”
- Font-Italic=“true”
- Font-Names=“Comic Sans MS”
- Font-Size=“Large”
- Text=“Please wait page updating…..”
- >
- </asp:Label>
- </ProgressTemplate>
- </asp:UpdateProgress>
- <br />
- <asp:UpdatePanel ID=“UpdatePanel1″ runat=“server”>
- <ContentTemplate>
- <asp:BulletedList
- ID=“BulletedList1″
- runat=“server”
- ForeColor=“DarkSeaGreen”
- BulletStyle=“LowerAlpha”
- BorderColor=“LawnGreen”
- BorderWidth=“1″
- >
- </asp:BulletedList>
- <br /><br />
- <asp:Button
- ID=“Button1″
- runat=“server”
- OnClick=“Button1_Click”
- Font-Bold=“true”
- Height=“45″
- Text=“Get Button Click System Time”
- ForeColor=“DodgerBlue”
- />
- </ContentTemplate>
- </asp:UpdatePanel>
- </div>
- </form>
- </body>
- </html>




No comments:
Post a Comment