Display all page event in asp label (C#)
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Page Load";
}
void Button1_Click(object sender, EventArgs e)
{
Label1.Text += "<br />Button Click";
}
void Page_PreRender()
{
Label1.Text += "<br />Page PreRender";
}
</script>
<html>
<head>
<title>Show Page Events</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button
id="Button1"
Text="Click Here"
OnClick="Button1_Click"
Runat="server" />
<asp:Label
id="Label1"
Runat="server" />
</div>
</form>
</body>
</html>
Related examples in the same category