English 中文(简体)
共享模板网站:作为px(c#)与raz(cshtml)
原标题:Share template site.master aspx(c#) with razor(cshtml)

I have upgraded my project to mvc3 and want to keep all my pages and add new into it. Now my question is if i start using razor, how can share my site.master template page between view.aspx(C#) and razor views(cshtml). This is because i do not want to have my master page and its code duplicated for obvious reasons.

最佳回答
问题回答

You cannot use Master pages (.master) with razor views (.cshtml). They are not compatible, razor views require a layout page to achieve what master pages offer.

你可以创建一个与目前主页相同的排版网页。 这实际上不会重复,因为它们不兼容。

或者更糟的是,你只能把所有东西变成raz子,而现有的工具可以帮助使这一进程自动化。 https://github.com/telerik/razor-converter” rel=“nofollow”





相关问题
ASP.Net MVC - Handle Multiple Checkboxes

Ok, I have a role based permission system in place and would like admin s to be able to edit the permissions for each role. To do this I need to load lots of checkboxes, however I m struggling with ...

Entity Framework error when submitting empty fields

VS 2010 Beta 2, .NET 4. In my ASP.NET MVC 2 application, when I submit a form to an action method that accepts an object created by the entity framework, I get the following error: Exception Details:...

ASP.Net MVC Architecture - Location of ViewModels

We have a decent sized MVC project running well at the moment, i ve started to look at some re-factoring and I have a question. At the moment the Data Layer and Service Layer is stored in a seperate ...

ASP.Net MVC Go To Declaration On view

Is there anyway when in an MVC view to right click a function call and get to the declaration? Like you can do in the code behind/controllers

ASP.NET MVC 2 Beta - Default Model Binder

I m experiencing some different behavior after switching from ASP.NET MVC 1.0 to ASP.NET MVC 2 Beta. I checked the breaking changes but it s not clear where the issue lies. The problem has to do with ...

Asp.net MVC Dynamic Menu System

In our current Asp.net MVC application we have 2 menu systems one accross the top and one on the left hand side. Now we have a partial view that renders the menu, however is the only way for this too ...

热门标签