T4MVC MVC2 Views in areas not generated

I am just creating an empty MVC2 project. Add an area and controller and look at it. Include the T4MVC files in the project and run the custom tool.

Everything is created except for ViewNames for submissions in the Area.

My tree structure:

Areas

  • Myarea
    • Controllers
      • MyTestController.cs
    • Views
      • Mytest
        • MyTestView.aspx
      • MySecondTestView.aspx

As I can see the views directly in the Views folder, as well as in folders named by the controller.

Has anyone experienced something like this?

+3
source share
2 answers

T4MVC definitely supports access to views in the Area. I just tried the following on a new project:

  • 'Stuff'
  • Foo
  • Index()
  • T4MVC

:

    public virtual ActionResult Index()
    {
        return View(Views.Index);
    }

    public virtual ActionResult Index()
    {
        return View(MVC.Stuff.Foo.Views.Index);
    }
+2

ASP.NET MVC 2 , , . .

, MyTestController.cs . , .

MVC Test.aspx MyArea/Views/MyTest

, Test.aspx /​​MyArea/Views/Shared

/Views/Shared.

[, , , 4, ... , ]

Test.aspx , .

, , . . MVC , MVC .

0

Source: https://habr.com/ru/post/1772059/


All Articles