zoukankan      html  css  js  c++  java
  • 探Button控件的Click事件发生始末

    先贴结果图:

    点击后:

    页面代码:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    	<title></title>
    </head>
    <body>
    	<form id="form1" runat="server">
    	<div>
    		<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    		<hr />
    		<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
    	</div>
    	</form>
    </body>
    </html>
    

      

    public partial class _Default : System.Web.UI.Page
    {
    	Stopwatch watch = new Stopwatch();
    	public _Default()
    	{
    		watch.Start();
    	}
    	protected void Page_PreInit(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_PreInit<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_PreInit<br/>";
    	}
    	protected void Page_Init(object sender, EventArgs e)
    	{
    		//System.Threading.Thread.Sleep(1000);
    		Response.Write(watch.ElapsedTicks + ": Page_Init<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_Init<br/>";
    	}
    	protected void Page_InitComplete(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_InitComplete<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_InitComplete<br/>";
    	}
    	protected void Page_PreLoad(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_PreLoad<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_PreLoad<br/>";
    	}
    	protected void Page_Load(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_Load<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_Load<br/>";
    	}
    	protected void Page_LoadComplete(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_LoadComplete<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_LoadComplete<br/>";
    	}
    	protected void Page_PreRender(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_PreRender<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_PreRender<br/>";
    	}
    	protected void Page_PreRenderComplete(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_PreRenderComplete<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_PreRenderComplete<br/>";
    	}
    	protected void Page_SaveState(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_SaveState<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_SaveState<br/>";
    	}
    	protected void Page_SaveStateComplete(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_SaveStateComplete<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_SaveStateComplete<br/>";
    	}
    	protected void Page_Render(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Page_Render<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Page_Render<br/>";
    	}
    
    	protected void Button1_Click(object sender, EventArgs e)
    	{
    		Response.Write(watch.ElapsedTicks + ": Button1_Click<br/>");
    		Label1.Text += watch.ElapsedTicks + ": Button1_Click<br/>";
    	}
    }
    

    MSDN: ASP.NET 页生命周期概述

  • 相关阅读:
    XSS 1
    KALI修改密码
    bugku web4
    16进制 32进制 base64之间的区别
    buuctf
    buuctf wireshark
    buuctf 变异凯撒
    2016集训测试赛(二十)Problem A: Y队列
    USACO 4.1.1 麦香牛块 Beef McNuggets
    2016集训测试赛(十八)Problem C: 集串雷 既分数规划学习笔记
  • 原文地址:https://www.cnblogs.com/scotcn/p/2476588.html
Copyright © 2011-2022 走看看