ASP.NET MVC母版页 [英] ASP.NET MVC Master Pages

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

问题描述

有什么ASP.NET母版页和MVC母版页之间的区别?而AJAX母版页是怎么回事?

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

推荐答案

主要是它归结为默认控件和继承。

Mostly it comes down to the default controls and inheritance.

阿贾克斯大师和ASP.NET母无论从System.Web.UI.MasterPage继承,而MVC硕士学位ViewMasterPage继承。

The AJAX Master and ASP.NET Master both inherit from System.Web.UI.MasterPage, while the MVC Master inherits from ViewMasterPage.

显然,这些给你稍有不同的控件在这 - 由约翰·克莱顿,在ViewMasterPage公开的Ajax / HTML / URL助手之类的,这是不提供给其他MasterPages。

Obviously, these give you slightly different controls on this - as stated by John Clayton, the ViewMasterPage exposes the Ajax/Html/Url helpers and the like, which are not available to the other MasterPages.

除此之外,默认控件略有不同:

Other than that, the default controls are slightly different:


  • ASP.NET母版页将默认窗体和两个控制的ContentPlaceHolder(一个在头,一个在形式。

  • AJAX母版页还增加了窗体控件内ScriptManager控件。

  • MVC硕士(取决于版本 - 我指的是在测试版)。只是有两个的ContentPlaceHolder控件(头部和身体)

在生命周期区别来自页/的ViewPage,而不是母版/ ViewMasterPage控制。

The "lifecycle differences" come from the Page/ViewPage, rather than the MasterPage/ViewMasterPage controls.

这篇关于ASP.NET MVC母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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