How to register areas for routing

前端 未结 3 1178
野性不改
野性不改 2020-12-01 07:58

I created MVC Application that have 3 different Area. (Admin, User, News) This is my RouteConfig.cs File in App_Start directory:

public class RouteConfig
{
          


        
3条回答
  •  渐次进展
    2020-12-01 08:12

    Call AreaRegistration.RegisterAllAreas() somewhere in your RegisterRoutes

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        AreaRegistration.RegisterAllAreas();
        ....
    }
    

    Tip: Use a tool like RouteDebugger 2.0 or Routing Debugger to investigate your routes

    Get latest NuGet: Route Debugger for MVC or RouteDebugger for WepApi

    Here's a tutorial on How to set up and use RouteDebugger with WebApi

提交回复
热议问题