结合ASP.NET Webiste和ASP.NET MVC3

结合ASP.NET Webiste和ASP.NET MVC3

问题描述:



我们运行的网站完全是ASP.NET(3.5版).该网站随着时间的推移发展良好.我们正在考虑一个新项目,我们要为其应用ASP.NET MVC3.

我的问题是,如果我们尝试设计并迈向MVC3,是否有办法将旧的ASP.NET网站链接到MVC3应用程序?还是会引起任何问题?例如,是否可以在ASP.NET网站中扩展前一个域(myDomain.com)的链接,如果转到myDomain.com/newProject,该链接将在其中运行mvc3应用程序?
任何建议都将不胜感激.

Hi,

We have a website running that is completely ASP.NET (version 3.5). The website has grown well over time. We have a new project in mind, which we want to apply ASP.NET MVC3 for.

My question is, if we try to design and move toward MVC3, is there a way to link the old ASP.NET website to MVC3 application? or would this cause any problems? for example can a link for the previous domain (myDomain.com) be extended in the ASP.NET website, where in if you go to myDomain.com/newProject would run the mvc3 app?

Any suggestions are greatly appreciated.

为什么不呢?网站还是仍然是基于MVC的网站.如果您的旧网站经过合理设计,则不会造成任何问题.进一步的细节在很大程度上取决于您现有的代码,所需的修改,并且首先取决于您要多么紧密地集成它们.如果您的旧站点没有严重的错误,并且耦合将变得非常松散,请考虑问题已经解决(毕竟,两个不相关的站点可以相互添加一些引用;它可以更改其功能吗?).如果您需要更紧密的集成-这要视情况而定.

您需要制定一个合理的集成计划,也许要在中间阶段保持生产的两个部分.通过这种方法,您可以从非常松散的集成过渡到更紧密的阶段.同样,它很大程度上取决于现有和所需的功能.

—SA
Why not? A Web site is still a Web site, MVC-based or not. It should not cause any problems if your legacy Web site was reasonably designed. Further detail highly depends on your existing code, required modifications and, first of all, on how tightly do you want to integrate them. If your legacy site does not have critical bugs and the coupling is going to be very loose, consider the problem is already solved (after all, two unrelated sites can just add a few references to each other; can it change their functionality?). If you need tighter integration — it depends.

You need to develop a sound plan of integration, perhaps with intermediate stages keeping both parts of production. In this approach, you could migrate from a very loose integration to more tight in stages. Again, it highly depends of existing and required functionality.

—SA


这非常容易.下面的文章清楚地说明了操作方法.将ASP.NET MVC 3集成到现有的升级的ASP.NET 4 Web Forms应用程序中 [ ^ ]
It''s pretty much easy. The following article explained clearly how to do it.Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications[^]