ASP.NET 页面生命周期说明 [英] ASP.NET page life cycle explanation

查看:35
本文介绍了ASP.NET 页面生命周期说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一段时间前的一次采访中被要求解释 ASP.NET 页面生命周期.我确实向他解释过,但他对我的回答并不满意.有人可以向我解释一下生命周期吗?

解决方案

ASP.NET页面生命周期共有10个事件,顺序为:

  1. 初始化
  2. 加载视图状态
  3. 回传数据
  4. 加载
  5. 验证
  6. 活动
  7. 预渲染
  8. 保存视图状态
  9. 渲染
  10. 卸载

下面是 ASP.NET 页面生命周期的图形视图,以及该事件中预期的代码类型.我建议你阅读

图片来源:我自己的文章 https://www.c-sharpcorner.com/uploadfile/shivprasadk/Asp-Net-application-and-page-life-cycle/ 2010 年 4 月 19 日

I was asked to explain the ASP.NET page life cycle in an interview some time back. I did explain it to him, but he was not satisfied with my answer. Could someone explain the life cycle to me please?

解决方案

There are 10 events in ASP.NET page life cycle, and the sequence is:

  1. Init
  2. Load view state
  3. Post back data
  4. Load
  5. Validate
  6. Events
  7. Pre-render
  8. Save view state
  9. Render
  10. Unload

Below is a pictorial view of ASP.NET Page life cycle with what kind of code is expected in that event. I suggest you read this article I wrote on the ASP.NET Page life cycle, which explains each of the 10 events in detail and when to use them.

Image source: my own article at https://www.c-sharpcorner.com/uploadfile/shivprasadk/Asp-Net-application-and-page-life-cycle/ from 19 April 2010

这篇关于ASP.NET 页面生命周期说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆