tnblog
首页
视频
资源
登录

ASP.NET中webform中的几个生命周期函数

3531人阅读 2019/2/27 20:19 总访问:338796 评论:2 收藏:0 手机
分类: NET


ASP.NET中webform中的几个生命周期函数,还有很多直接重写父类的虚函数就可以了

  public partial class PageLearn : System.Web.UI.Page
    {
        protected override void OnLoadComplete(EventArgs e)
        {
            Response.Write("OnLoadComplete,加载完成<br/>");
        }

        protected override void OnPreInit(EventArgs e)
        {
            Response.Write("OnPreInit,初始化之前<br/>");
        }

        protected override void OnPreLoad(EventArgs e)
        {
            Response.Write("OnPreLoad,加载之前<br/>");
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write("Page_Load,页面加载.......<br/>");
        }
    }

效果如下:



评价
吃亏决不亏,惜福才有福
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
欢迎加群交流技术