更改MVC文件夹结构

问题描述 投票:0回答:1

创建项目时,文件夹结构通常类似于:

  • 型号
    • SomePage
      • SomePage.cs
  • 控制器
    • SomePage
      • SomePageController.cs
  • 视图
    • SomePage
      • Index.cshtml
    • Web.config

我想创建一个类似的结构:

  • MVC
    • SomePage
      • 型号
        • SomePage.cs
      • 控制器
        • SomePageController.cs
      • 视图
        • Index.cshtml

我已经能够覆盖RazorViewEngine来正确搜索我的视图。但是,我的Razor Views没有识别出“模型”这个名称。我相信这与Views文件夹中的Web.config有关。如何容纳我的新结构?

c# model-view-controller razor view
1个回答
0
投票

您正在谈论诸如MVC中的Areas之类的东西,显示this link

© www.soinside.com 2019 - 2024. All rights reserved.