Reputation: 133
return RedirectToAction("Index", "Dashboard");
URL Should be
But this is showing
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*x}", new { x = @".*\.asmx(/.*)?" });
routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "UserLogin", action = "Index", id = UrlParameter.Optional }
);
}
Upvotes: 0
Views: 116
Reputation: 3267
May be this one can helps you, Set this in your applicaiton's web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
<handlers>
<remove name="UrlRoutingHandler"/>
</handlers>
</system.webServer>
Also you can do this,
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Upvotes: 1
Reputation: 38539
This is likely because your route config contains something like
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
Where by your default action is Index
Meaning, when you do RedirectToAction("Index", "Dashboard");
it ignores the index, because this is already the default.
Upvotes: 2