Add this on your ASPX design page
<asp:Label ID="Label1" runat="server" Font-Size="Larger" ForeColor="Green">
</asp:Label>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Click Me" OnClick="Button1_Click"
Font-Bold="true" ForeColor="Red" />
Add this on your C# page
protected void Button1_Click(object sender, System.EventArgs e)
{
Application.Lock();
int clickMeCounter = 0;
if (Application["clickMeCounter"] != null)
{
clickMeCounter = (int)Application["clickMeCounter"];
}
clickMeCounter++;
Application["clickMeCounter"] = clickMeCounter;
Application.UnLock();
Label1.Text = "Button Clicked: " + clickMeCounter.ToString() + " times";
}