Mine is simple scenario but I am confused on how routing works.
I have three controllers SearchHome, Home and Account.
Here is route config.
routes.MapRoute("default", "{controller}/{action}/{name}",
new { controller = "SearchHome", action = "Home", name = UrlParameter.Optional }, new[] { "AppName" }
);
I do not want to show my controller name in URL. So, I take away controller in my above code and make it as below.
routes.MapRoute("default", "{action}/{name}",
new { controller = "SearchHome", action = "Home", name = UrlParameter.Optional }, new[] { "AppName" }
);
Controller Name is not showing for SearchHome controller views but Home and Account Views are showing up at all.
What am I doing wrong ? Can I write a seperate route for each controller ?
Here is the same issue but The answer is not working for me.