本文介绍了什么是Asp.net页面的生命周期和Asp.net的mvc页面生命周期的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是Asp.net页面生命周期的区别
和Asp.net的mvc页面生命周期?

Asp.net页面生命周期只需记住SILVERū
结果S-启动
结果我初始化
结果L-负载
结果V-验证
结果E-事件处理
结果 - [R -Rendering
结果ü-unload
结果有什么实际的差异MVC和Asp.net页面?


解决方案

Asp.net MVC页面生命周期是web表单完全不同,不存在的事件,如我们在Web表单,例如:pre渲染,的OnInit等当我们请求一个URL的唯一的事情发生了一些控制器动作被调用,响应在浏览器中呈现。

Asp.net MVC页面生命周期:

MSDN 以下是参与asp.net mvc的页面生命周期的主要步骤:

1)路由

This interface has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for processing the request and generating the response. So in asp.net application it is simple, you request for a page in the url like http://mysite1\default.aspx and then it search for that page on the disk and execute the processrequest method and generate the response.

2)Url Routing Module intercepts the Request:

3)MVC Handler Executes

4) Controller Executes

controller is called and its action called requested by user.

5)Render View Method Called

Abstract Explanation Diagram:

In Depth Diagram:

Request Flow"

Here is the asp.net mvc request flow:

Reference Links

For Understanding in details refer to Understanding of MVC Page LifCycle

Also Here is another good article explaining MVC page life cycle

这篇关于什么是Asp.net页面的生命周期和Asp.net的mvc页面生命周期的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 11:15