Asp.Net MVC Areas, how can I use them?

三世轮回 提交于 2019-12-07 10:19:00

问题


I've got two questions about Asp.Net MVC areas. I have only a shallow understanding of areas from what I've heard about them in various podcasts but I think I understand fairly well what they're supposed to be used for. Now my question is if I could also use them to enable me to gradually switch from development in Asp.Net webforms with VB to Asp.Net MVC with C#.

  1. Can I mix areas of different languages in one application, for example one area is a C# project and another is a VB.Net project.
  2. Could I use the areas feature to incorporate MVC into an existing webforms application? Lets say I have a Asp.Net webforms application but I want any new "pages" to be written using MVC, could I create a new MVC project and then "jack it in" as an area into the existing webforms application?

回答1:


In response to your questions:

  1. Yes. If it's a separate assembly, then it won't matter if it's in c# or VB.net.
  2. I'd say yes - it will help to keep your MVC stuff separate, but of course you will need the basic bootstrap stuff in your base webforms project. Good idea.

I've recently started introducing MVC into an older webforms site, and it's well worth the effort.



来源:https://stackoverflow.com/questions/1841520/asp-net-mvc-areas-how-can-i-use-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!