what is the difference between Asp.net page life cycle and Asp.net Mvc page life cycle?

前端 未结 2 2101

what is the difference between Asp.net page life cycle and Asp.net Mvc page life cycle ?

Asp.net page life cycle Simply remember SILVER U
s- Start
I-Initializa

2条回答
  •  轮回少年
    2021-01-30 15:41

    ASP.NET Web Forms

    • ASP.NET Web Forms use Page controller pattern approach for rendering layout. In this approach, every page has its own controller, i.e., code-behind file that processes the request.
    • In order to achieve stateful behavior, viewstate is used. Purpose was to give developers the same experience of a typical WinForms application.

    ASP.NET MVC

    • It uses Front Controller approach. That approach means a common controller for all pages processes the requests.

    • ASP.NET MVC approach is stateless as that of the web. So there is no concept of viewstate.

    But in actual in MVC there is no page life cycle per se (because there is no 'page' object), but there is a request processing pipeline:

    You could take help from here nice description or refer to MVC4 and page life cycle?

提交回复
热议问题