You are using Attribute Routing , then just remembering that you should call the method MapMvcAttributeRoutes () its RouteConfig
with the following line:
routes.MapMvcAttributeRoutes();
Once you've done this, just add the attribute to your controller
, just as you are doing.
[Route("video/categoria/new-movies/{page?}")]
public async Task<ActionResult> Index(int? page)
{
}
Until that part I suppose you already own, so now let's go to your ActionLink () .
@Html.ActionLink("TEXTO","Index","CONTROLLER", new { page = 3 }, null)
Remembering that your actionLink
"works" as follows:
MvcHtmlString HtmlHelper.ActionLink(
string linkText,
string actionName,
string controllerName,
object routeValues,
object htmlAttributes
)
The "rough way", first you pass the text, then the Action
, Controller
, route values and html attributes.
As you can see, in the% w / w you do not care about routes, just call Action and Controller , remembering to pass the required parameters.