user2412672
user2412672

Reputation: 1479

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?

Upvotes: 3

Views: 2202

Answers (1)

Shyju
Shyju

Reputation: 218722

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);
}

Upvotes: 5

Related Questions