Web表单在同一个项目视图引擎和锐利的视图引擎 [英] Web forms view engine and razor view engine in the same project

查看:150
本文介绍了Web表单在同一个项目视图引擎和锐利的视图引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上到这一点已使用Web窗体查看其所有视图引擎是一个产品的工作。有太多的文件进行重构。

I work on a product which up to this point has been using the web forms view engine for all its views. There are far too many files to refactor.

是否有任何理由为什么我不能用剃刀和网络形式在同一个项目视图引擎?

Is there any reason why I cannot use razor and the web forms view engine in the same project?

推荐答案

ASP.NET MVC支持使用中都使用缺省配置在同一个项目的剃刀和WebForms的意见。

ASP.NET MVC supports the use of both the Razor and WebForms views in the same project with the default configuration.

默认视图引擎将搜索视图按照此顺序

The default View engine will search for a view in this order

~/Views/Home/Index.aspx (WebForms)
~/Views/Shared/Index.aspx (WebForms)
~/Views/Home/Index.cshtml (Razor)
~/Views/Shared/Index.cshtml (Razor)

所以,如果你有一个WebForms和相同的名称,则WebForms的视图将被显示的的Razor视图。

So if you have a WebForms and Razor view of the same name then the WebForms view will be shown.

斯科特Hansleman有更多的细节混合在一个布局WebForms和剃刀景观 /母版页

这篇关于Web表单在同一个项目视图引擎和锐利的视图引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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