ASP.NET MVC Master Pages

前端 未结 3 1764
北海茫月
北海茫月 2021-02-04 03:17

What\'s the difference between the ASP.NET Master Page, and the MVC Master Page? And the AJAX Master Page for that matter?

3条回答
  •  遥遥无期
    2021-02-04 03:37

    As a quick guess I'd have to say that the answer would be "lifecycle". ASP.NET WebForms, MVC and AJAX all have different lifecycles which would effect the events which need to be responded to by a master page control. A WebForms Master Page would need to respond to Load, DataBind, PreRender, Render, etc. An MVC Master Page would probably (not sure on this) only need the Render action. All the other events are superfluous and the equivalent code would be found in the controller. Lastly, the AJAX Master Page would need to handle AJAX requests on top of normal ones.

    As I said, this is a bit of a guess so more research is recommended

提交回复
热议问题