我们可以在现有的ASP.NET 4网站上使用Razor吗? [英] Can we use Razor on an existing ASP.NET 4 website?

查看:65
本文介绍了我们可以在现有的ASP.NET 4网站上使用Razor吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在现有的ASP.NET 4网站上使用Razor?

Is it possible to use Razor on an existing ASP.NET 4 website?

推荐答案

如果您已经拥有VS2010和MVC 3(其中包括用于构建ASP.NET的Visual Studio工具),则甚至无需在Web Matrix中打开该站点.剃刀网站).安装MVC 3可使开发Razor页面所需的库可用,甚至现有的Web应用程序也可以使用.

You shouldn't even need to open the site in Web Matrix if you already have VS2010 and MVC 3 (which includes the Visual Studio tools for building ASP.NET Razor websites) installed. Installing MVC 3 makes the libraries required for developing Razor pages available, even to existing web applications.

请参阅:

http://www. asp.net/webmatrix/tutorials/program-asp-net-web-pages-in-visual-studio

您不需要创建新的Web站点(按照说明进行操作).您可以打开一个现有网站,右键单击该网站的根文件夹,单击添加项目",然后可以看到网页(剃刀)"作为选项.

You don't need to create a new Web Pages site (as per the instructions). You can just open up an existing web site, right click the site's root folder, click add item and you should see "Web Page (Razor)" as an option.

Inellisense和调试可以像Web窗体页面一样在Razor页面中工作

Inellisense and debugging works in the Razor pages just like the Web Forms pages

如上所述,请记住,ASP.Net Web Pages(Razor)和ASP.Net WebForms确实是不同的平台,并且每个(都至少不能使用)可重用组件

As stated above, keep in mind that ASP.Net Web Pages (Razor) and ASP.Net WebForms are really different platforms, and the reusable components of each can not (or at least should not) be used

这篇关于我们可以在现有的ASP.NET 4网站上使用Razor吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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