Reputation: 375
Given this: in index.cshtml:
a href="@Url.Action("Create", "Request")">Create Request</a>
global.asax:
routes.MapRoute(
"Request",
"request/{action}",
new {controller="Request",action="Create" }
);
It redirects to this url: http://localhost:16997/request. How would I make it go to http://localhost:16997/request/create ? If I just type the 'create' in the url, it displays the Content of the create method appropriately.
Upvotes: 1
Views: 1389
Reputation: 1038840
Remove the action default value in your route definition:
routes.MapRoute(
"Request",
"request/{action}",
new { controller = "Request" }
);
Upvotes: 1