user3603578
user3603578

Reputation: 7

ASP.Net MVC Routing for fixed URL

I have area BackOffice, controller BrandController and action Edit. I want to route following URL to this action: /BackOffice/Brand/Act/Manage

The URL is fixed, none of the elements shall be changeable. How can I do that using MapRoute ?

Upvotes: 0

Views: 80

Answers (1)

GSerg
GSerg

Reputation: 78183

In the AreaRegistration class for BackOffice:

public override void RegisterArea(AreaRegistrationContext context) 
{
    context.MapRoute(
        null,
        "/BackOffice/Brand/Act/Manage",
        new { controller = "Brand", action = "Edit" }
    );
}

Upvotes: 1

Related Questions