asp.net mvc routing - Route attributes overriding route -
here's route:
routes.maproute("login", "", new { action = "login", controller = "authentication"}) .datatokens = new routevaluedictionary(new { area = "authentication" }); routes.mapmvcattributeroutes();
here controller action:
[routearea("authentication", areaprefix = "auth")] [route("{action=login}")] public class authenticationcontroller : basecontroller { [httpget] [allowanonymous] public actionresult login() { ...
if comment out routes.mapmvcattributeroutes();
can request login action using '/'. if left in route doesn't work , 404.
how make default route website login page form area?
the area being registered independently of attributes.
i removed convention route , added following <system.web>
in web.config:
<urlmappings enabled="true"> <clear /> <add url="~/" mappedurl="~/auth" /> </urlmappings>
Comments
Post a Comment