Search code examples
.netasp.net-mvcasp.net-web-apiroutes

ASP.NET MVC Web API Help page routing


Now by default ASP.NET MVC Web API Help page accessible by http://localhost:50784/Help route I want to change it to http://localhost:50784/Developers. How could I make this?


Solution

  • By default, there is an area called Help registered to your route configuration. You can change that to your custom name.

    You will see a HelpPageAreaRegistration.cs file under ~/Areas/HelpPage where we have the route registration. You can edit it to have your custom name

    public override void RegisterArea(AreaRegistrationContext context)
    {
        context.MapRoute(
            "HelpPage_Default",
            "Developers/{action}/{apiId}",
            new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
    
        HelpPageConfig.Register(GlobalConfiguration.Configuration);
    }