MVC can only be created under the areas name folder, "area" (with the accompanying Controller,view,model). However, there are times when you want to create a module folder under the areas, which is created in the section below the module folder. Can not be implemented in direct operation. Can do this
1. Create a module folder under areas, such as aboutlinq
2. Add a region under areas, such as LINQ
3. Cut the area LINQ to Aboutlinq
4. After modification, the CS file below the LINQ area.
Using SYSTEM.WEB.MVC;
Modified here 1
Namespace MyTest.Areas.AboutLinq.LINQ
{
public class Linqarearegistration:arearegistration
{
public override string AreaName
{
Get
{
Modified here 2
return "Aboutlinq/linq";
}
}
public override void Registerarea (AreaRegistrationContext context)
{
Context. MapRoute (
Modified here 3
"Aboutlinq_linq_default",
Modified here 4
"Aboutlinq/linq/{controller}/{action}/{id}",
New {action = "Index", id = urlparameter.optional}
);
}
}
}
5. Create a generated view below Aboutlinq, cut to LINQ below.
Http://localhost:1876/AboutLinq/LINQ/LinqSentence/Index will have access to the
MVC Multi-level areas