How to use UpdatePanel in asp.net ajax

UpdatePanel in asp.net ajax
UsingUpdatePanel.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>
<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Label1.Text = "0";
        }
    }
    protected void Timer1_Tick(object sender, System.EventArgs e)
    {
        int counter = Convert.ToInt32(Label1.Text);
        counter = counter + 1;
        Label1.Text = counter.ToString();
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax UpdatePanel - How to use UpdatePanel in asp.net ajax</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:DodgerBlue; font-style:italic;">Ajax UpdatePanel Example: How To Use UpdatePanel</h2>
        <hr width="550" align="left" color="CornFlowerBlue" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Timer 
                    ID="Timer1"
                    runat="server"
                    Interval="1000"
                    OnTick="Timer1_Tick"
                    >
                </asp:Timer>
                <br />
                <asp:Label 
                    ID="Label1" 
                    runat="server" 
                    Text="Test Label"
                    ForeColor="DeepPink"
                    Font-Size="XX-Large"
                    Font-Names="Comic Sans MS"
                    Font-Bold="true"
                    >
                </asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
Related asp.net ajax examples