We have a web application written in ASP.NET for .NET 3.5, using standard web forms.
我们有一个用ASP编写的web应用程序。NET 3.5,使用标准的web表单。
Going forward we want to start building new features, and over time migrate existing features, in ASP.NET MVC.
展望未来,我们希望开始构建新的特性,并随着时间的推移在ASP中迁移现有的特性。净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.?
这是可行的吗?我们可以将必要的文件添加到ASP中吗?NET web应用程序,因此“升级”它以与MVC足够兼容,以便我们可以开始添加路由、控制器、视图等。
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.
旧网站使用的框架集包含一个顶部标题、一个左菜单和一个主内容。我所设想的是为所有现有页面创建一个新的masterpage,将所有这些内容集成到每个页面中,然后开始使用视图添加新的页面。
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:
我理解,除非我们升级到。net 4,否则我们不能使用MVC 3,所以我认为我们有以下选项:
- 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.
- 建立一个新网站,在登录主网站时自动使用相同的凭证登录新网站,并在网站之间建立链接。我发现这个解决方案有很多问题。
- 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.
- ASP集成。NET MVC 2添加到现有的软件中,添加必要的文件,并开始以MVC风格添加新内容,只修复旧文件中的关键bug,并随着时间的推移将其迁移到MVC。
- Upgrade to .NET 4 and integrate ASP.NET MVC 3, pretty much the rest the same as option 2.
- 升级到。net 4并集成ASP。NET MVC 3,几乎和选项2一样。
- Wait until we can schedule a full rewrite, likely to not happen in any foreseeable future.
- 等到我们可以安排一个完整的重写,很可能在任何可预见的将来都不会发生。
- Don't do it, keep web forms.
- 不要这样做,保留web表单。
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.
选项2和3是我们想要的,其余的只是为了完整性。
Are those options feasible? Do we have other options I haven't thought of?
这些选项是可行的吗?我们还有其他我没有想到的选择吗?
1 个解决方案
#1
2
It is possible to mix webforms and mvc in one web site. Take a look at this article.
可以在一个web站点中混合使用webforms和mvc。看看这篇文章。
#1
2
It is possible to mix webforms and mvc in one web site. Take a look at this article.
可以在一个web站点中混合使用webforms和mvc。看看这篇文章。