My ASP.NET MVC project route seems to be ignoring the default when composing URLs For example, Url.Action ("index", "home")
return / home / index /
, while returning it only to /
There is no problem with url (which I have seen in all my other MVC websites) using , eg. By going to http: // myserver /
, the default controller and verb get correctly.
How can I correct the behavior? (Note how I have done this behavior get , but no one is suffering from this opposite problem.)
This project is not fantastic, no custom routing handler is. , And routing configuration is quite simple: "public-static zero register routs" {routes.IgnoreRoute ("{resource} .axd / { * PathInfo} "); Routes.IgnoreRoute ("LoginHandler"); ("Default", url: "{controller} / {action} / {* id}", default: new {controller = "home", action = "index", id = urlParameter.optional}). ; }
( *
is there because some actions use arbitrary strings in the form of identifiers which can include embedded slashes, and without asterisk, the path The URL does not match for this.)
No comments:
Post a Comment