mvc中的母版页问题 [英] master page problem in mvc
本文介绍了mvc中的母版页问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
(我在Razor MVC 4.0上工作。)我有一个.cshtml页面,它在我的应用程序中作为母版页工作,它工作正常。 。现在我将一个Web表单放入我的应用程序中。如何将此.cshtml页面作为母版页添加到此webform。
(I worked on Razor MVC 4.0 .)i have a .cshtml page is there , it's works as a master page in my application, it's working fine. . now i taken one web form into my application. how to add this .cshtml page as a master page to this webform.
推荐答案
默认情况下,MVC使用〜/ Views / Shared / _Layout.cshtml作为默认母版页。但是如果你有一个自定义母版页,你可以在创建页面时使用,也可以在下面更改母版页
@ {
布局=自定义主网址;
}
By default MVC uses ~/Views/Shared/_Layout.cshtml as default masterpage. But if you have a custom master page, you can either ste while creating the page, else you can change the master page as below
@{
Layout="custom master url";
}
这篇关于mvc中的母版页问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文