In other word we can say that it enables you to perform partial page rendering. You can Update a portion of a web page after a time interval or after perform any event.
To do this task we use following AJAX control.
UpdatePanel
Update panel is a Server-Side AJAX control. The update panel allow us to update a portion of a page without updating the entire page. In other word we can say that it enables us to perform partial page rendering.
Timer
Timer is also a Server-Side AJAX control. The timer control is great to be used when you have an area of user interface that you want to be dynamically update based on some periodic interval.
Example:
First Create a website, then add a web form and copy the below code into aspx page.
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:ScriptManager ID="ScriptManager1" runat="server">
- </asp:ScriptManager>
- <div>
- Page Time:
- <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
- <ContentTemplate>
- Update Panel Time:
- <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
- <br />
- <asp:Button ID="Button1" runat="server" Text="Update" OnClick="Button1_Click" />
- <asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick">
- </asp:Timer>
- </ContentTemplate>
- </asp:UpdatePanel>
- </div>
- </form>
- </body>
- </html>


Rahul PrajapatPosted Aug 12, 2015, 11:34 PM
Thanks sir
Santhakumar MunuswamyPosted Aug 12, 2015, 3:21 PM
Thanks for sharing