English 中文(简体)
重组ASP.NET MVC Folders
原标题:Reorganizing ASP.NET MVC Folders

I m 想将网络表格移至mvc。 我需要处理的一个组织问题,是我们的多重结构。 按职能领域(例如)排列

  • Application
    • Functional Area (e.g. MyAccount)
      • Task 1 (Manage Notifications)
      • Task 2 (Change Payment Info)
      • etc..
    • Functional Area
      • Task 1
      • Task 2
      • etc..

这对我们基于任务的评估非常出色。 然而,根据我的理解,带有MVC射线探测器的缺省组织对电离层极差。

  • Controllers
    • Task1Controller.cs
    • Task2Controller.cs
  • Views
    • Task 1
      • ViewOne.aspx
      • ViewTwo.aspx
    • Task 2
      • ViewOne.aspx
  • Models

......

我愿保留我们目前的布局。 I m 设想一个更像的结构

  • Application
    • Functional Area (My Account)
      • Task 1
        • Controller
        • View 1
        • View 2
      • Task 2
        • Controller
        • View 1
        • View 2

......

我需要走哪些道路才能做到这一点? 如果我这样做的话,我会遭受什么样的痛苦,从公约中大大偏离?

问题回答

可在伙伴关系网站2.0上查阅。 NET MVC。

它们重新命名为Areas

更多来自Phil Haack的信息:

在这方面,Steve Sanderson说过:

这些领域的目的是使你能够把你的模型、看法和管制人员整理成合乎逻辑的“区域”。

  • Area1
    • Model
    • View
    • Controller
  • Area2
    • Model
    • View
    • Controller

<areas。 NET MVC 2.0。





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签