Asp.Net MVC领域,我该如何使用呢? [英] Asp.Net MVC Areas, how can I use them?

查看:103
本文介绍了Asp.Net MVC领域,我该如何使用呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有关于Asp.Net MVC地区两个问题。我从我的各种播客听见他们的领域只是一个粗浅的认识,但我想我明白相当好,他们应该怎么作。现在我的问题是,如果我还可以用它来使我逐渐从发展Asp.Net web表单用VB切换到Asp.Net MVC使用C#。


  1. 我可以在一个应用程序中混合使用不同语言的地区,例如,一个区域是一个C#项目,另一个是VB.Net项目。

  2. 我可以使用区域设有纳入MVC到现有的WebForms应用程序?可以说我有一个Asp.Net web表单应用程序,但我想任何新的页面来使用MVC写的,我可以创建一个新的MVC项目,然后作为一个区域到现有的web表单应用程序?

解决方案

在回答您的问题:


  1. 是。如果这是一个单独的程序,那么就不会,如果它在C#或VB.net关系。

  2. 我会说是的 - 这将有助于保持你的MVC的东西分开的,但当然,你需要的基本引导的东西,在你的基地web表单的项目。好主意。

我最近开始引入MVC为一个较旧的WebForms的网站,这是非常值得的。

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?

解决方案

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.

这篇关于Asp.Net MVC领域,我该如何使用呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆