开发者

Master page to Layout in MVC3

开发者 https://www.devze.com 2023-03-01 06:25 出处:网络
I have to user master page of MVC2 application in VS 2008 in MVC3 2010. Cananyone he开发者_运维问答lp me on thisYou cannot have WebForms master page (.Master file) with a Razor view (.cshtml file). If

I have to user master page of MVC2 application in VS 2008 in MVC3 2010. Cananyone he开发者_运维问答lp me on this


You cannot have WebForms master page (.Master file) with a Razor view (.cshtml file). If you want to use a WebForms master page you need to use a WebForms view (.aspx file). So simply put the Site.Master file in the ~/Views/Shared folder of your ASP.NET MVC 3 application and add a WebForms view implementing it (for example ~/Views/Home/Index.aspx).

0

精彩评论

暂无评论...
验证码 换一张
取 消