itemprop = "text">
Standard MVC 5 template.
That's why I'm trying to understand and create a named route to be used in this way:
& lt; A href = "@ Url.RouteUrl (Route name:" myroute ", root value: new {code =" 123 "}) This link should be linked to & lt; / a & gt;
In Home Controller: [Route ("Home / DOIT", name = "Myroft", HTTP GATE] Public Action Result DOIT (String Code)) {See Return () ;}
MvcAttributeRouting is definitely enabled in RoutConfig.cs:
public static zero register routs {routes.IgnoreRoute ("{ Resource} AXD / {* pathInfo} "); Routes.MapRoute (name:" default ", url:" {controller} / {action} / {id} ", d Fault: New {Admin = "Home", Action = "Index", ID = UrlParameter.Optional}); routes.MapMvcAttributeRoutes ();}
Because if it was not enabled One will get:
A path named 'myroute' was not found in the path collection. Name of the parameter: Name
But I'm getting:
The resource can not be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies), could be renamed, or temporarily The Uplbd may please review the following URL and make sure that it is spelled correctly.
Requested URL: / Home / IOT
What am I doing? Edit: Of course, I'm doing something wrong in the root attribute, because it also does not work:
[root ("doit")] / Code> or
[root ("Home / DOIT")]
Both give me 404, request URL's Regardless of
No comments:
Post a Comment