开发者

Adding MVC content to an existing ASP.NET application?

We have a web application written in ASP.NET for .NET 3.5, using standard web forms.

Going forward we want to start building new features, and over time migrate existing features, in ASP.NET MVC.

Is such a thing doable? Can we add the necessary files to an ASP.NET web application and thus "upgrade" it to be compatible enough with MVC so that we can start adding routes, controllers, views, etc.?

The old site is using a frameset containing a top header, a left menu, and a main content. What I envisioned was to create a new masterpage for all the开发者_运维知识库 existing pages, integrating all of those things into each page instead, and then start adding new pages using views instead.

I understand that unless we upgrade to .NET 4 we cannot use MVC 3, so the way I see it we have the following options:

  1. Build a new website, somehow auto logon the new site with the same credentials when logging in on the main site, and link between the sites. I see tons of problems with this solution.
  2. Integrate ASP.NET MVC 2 into the existing software, adding the necessary files, and starting to add new content in MVC style, only fixing critical bugs in the old files, and over time migrate them over to MVC.
  3. Upgrade to .NET 4 and integrate ASP.NET MVC 3, pretty much the rest the same as option 2.
  4. Wait until we can schedule a full rewrite, likely to not happen in any foreseeable future.
  5. Don't do it, keep web forms.

Note that a full rewrite is out of scope at the moment, so some transitional period is the only option we can do right now.

Option 2 and 3 are the ones we want, the rest are just for completeness.

Are those options feasible? Do we have other options I haven't thought of?


It is possible to mix webforms and mvc in one web site. Take a look at this article.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜