How to set default route in asp.net mvc application from web.config
How to set default route in asp.net mvc application from web.config
Solution:
Add Key web.config as below
<add key="DeafaultPageAfterLogin" value="/MyOrderedMeals" />
in controller or route.config file set redirect url to
if (ConfigurationManager.AppSettings["DeafaultPageAfterLogin"]!=null)
{
return Redirect(ConfigurationManager.AppSettings["DeafaultPageAfterLogin"].ToString());
}
in else part you can set default route.