ASP.NET Web Form Render Engine displays control tree? Finding Rendering Logic Information

I watched a video on Scott Hanselmnn that involved MVC 2 tricks / tips. He mentions how MVC 2 by default uses the ASP.NET Web Forms view engine to display view results; he mentions that the web form viewer is a little slower than it could be for MVC 2, as it generates a control tree and then outputs the HTML to the page (I hope I said correctly).

I was wondering what he meant when web forms generate a code tree before displaying HTML on a page. Does anyone have an idea of ​​the web form viewer and the steps of the rendering process for ASP.NET and MVC2?

+3
source share
2 answers

In Web Forms, HTML is generated by a hierarchy of controls, each of which should be called to display HTML code, and each of them contributes to the ViewState page. In addition, during the life cycle, many web forms are launched using Web Forms (Init, PreRender, etc.), and each control in the hierarchy also triggers similar events.

In MVC, the process could theoretically be much simpler, since you don't have a deep hierarchy of controls, you don't have a ViewState, and you don't have to fire events. However, MVC "contrailers" are disconnected from the ASP.NET platform, and so behind the scenes a lot of material in Web Forms still exists, although this is not necessary.

+1
source

ASP.Net WebForms "" HTTP. , WinForms , .. , ..

, , , WinForms:

TextBox.Text = "I hate viewstate!";

, , ​​ . , "Render yourself" . , HTTP-.

MVC , . MVC - .

+1

Source: https://habr.com/ru/post/1791636/


All Articles