混合ASP.NET MVC和WebForm应用程序 [英] Hybrid ASP.NET MVC and WebForm application

查看:215
本文介绍了混合ASP.NET MVC和WebForm应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的ASP.NET 4.0 网站(不是带有.csproj的Web应用程序)。我正在尝试将ASP.NET MVC 3插入到现有的应用程序中。我按照下面链接中的所有步骤操作,但它不起作用。


然后我从头开始尝试并创建了一个示例ASP.NET 网站(不是.csproj的Web应用程序)。那没起效。如果我浏览* .aspx页面,它可以工作。但是当我尝试导航到MVC控制器(如... / Home / Index)时,我发现404-Not
发现错误。


然后我创建了一个带有.csproj(而不是网站)的Web应用程序,并按照相同的步骤运行!!


这是否意味着无法插入MVC ASP.NET
网站中的3.0


http://www.packtpub.com/article/mixing-aspnet-webforms-and-aspnet-mvc



解决方案
是这是可能的文章比较以下
http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx
功能,如果你能找到原因,您的实现不工作。我没有尝试你提供的文章中的说明,但我已经用我粘贴的文章和它提供的其他资源制作了
混合。


I have an existing ASP.NET 4.0 web site (not Web application with a .csproj). I am trying to plug ASP.NET MVC 3 into this existing application.I followed all the steps in the link below but it did not work.

Then I tried from scratch and created a sample ASP.NET web site (not web application with .csproj). It did not work. If I browse to *.aspx page, it works. But when I try to navigate to MVC controller (like .../Home/Index), I get 404-Not found error.

Then I created a web application with a .csproj (instead of a web site) and followed the same steps and it worked!!

So does it mean that it is not possible to plug MVC 3.0 in an ASP.NET web site?

http://www.packtpub.com/article/mixing-aspnet-webforms-and-aspnet-mvc

解决方案

Yes it's possible compare the article to following http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx and if you can locate the reason why your implementation does not work. I didn't try instructions in the article you provided, but I've made the hybrid with the article I pasted and other sources it provides.


这篇关于混合ASP.NET MVC和WebForm应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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