Use Of Update Panel in your ASP.NET Application


If you want to use update panel in your asp application then try this.........
 
First Step :

In your drag script manager in your asp master page write this code in your aspx page

<div>
<asp:UpdatePanel ID="testupdatepanel" runat="server">
<ContentTemplate>
<asp:Label ID="lbltime" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>

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

</Triggers>
</UpdatePanel>
</div>
<div>
<asp:Button ID="btnUpdate" runat="server" Text="Update" onclick="btnUpdate_Click" />
</div>

Second Step:

Write this code in your cs file:

protected void btnUpdate_Click(object sender, EventArgs e)
    {
        lbltime.Text = System.DateTime.Now.ToString();
    }
Ebook Download
View all
Learn
View all