从 ASP.NET WebForms 迁移到 ASP.NET MVC
我正在为我工作的公司开发一个网络应用程序。我的团队几个月前开始开发该应用程序,并决定使用 ASP.NET WebForms 构建它。现在我们已经开发了相当多的代码,我们想知道 ASP.NET WebForms 是否是一个不错的选择。也许我们应该移民。好的,但是第一步是什么?我们不想从头开始重写一切。我们希望在未来(逐步)在 MVC 中添加新的内容并重写旧的部分。是否有可能以某种方式将 ASP.NET MVC 应用程序添加到当前的 WebForms 应用程序中?他们可以住在一起吗?
I'm developing a web application for a company which I work for. My team started working on the app few months ago and the decision was to build it with ASP.NET WebForms. Now we've quite a lot of the code developed and we're wondering if ASP.NET WebForms was a good choice. Maybe we should migrate. Ok, but what's the first step? We don't want to rewrite everything from scratch. We'd like to add a new stuff in MVC and rewrite the old part in the future (gradually). Is it possible to add somehow ASP.NET MVC application to current WebForms one? Can they live together?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Asp.net webforms 和 MVC 可以愉快地共存。您将添加一些包含和目录,并添加一条路线,这将导致您的网络表单页面被忽略。全部解释如下:
http://www.packtpub .com/article/mixing-asp.net-webforms-and-asp.net-mvc
Asp.net webforms and MVC can live happily together. You will add some includes and directores and add a route which will cause your webforms pages to be ignored. All explained here:
http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc
将 MVC 与 Web 表单混合起来并不是那么困难。基本上,您希望忽略 global.asax 中任何现有的 .aspx 路由,然后为要使用 MVC 构建的新页面添加路由。
有关更多详细信息,请参阅本文。
Mixing MVC with webforms is not that all hard. Basically, you want to ignore any exisiting .aspx routes in your global.asax, and then add routes for new pages that you want to build using MVC.
See this article for more details.