I am using ASP.NET MVC 3. I created an area called Administration. There is no default view associated with it, so if I type in http://www.mywebsite.com/Administration then there is an error. How would I go and define a default view when the user types in the above mentioned URL? Would I need to go and create a Home controller?
I would like to have something like:
http://www.mywebsite.com/Administration or
http://www.mywebsite.com/Administration/Index
AdministrationAreaRegistration.cs has the following:
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Administration_default",
"Administration/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
Not sure if this is possible?
You are about not to define default view, but default action. The code above misses the type of controller, action of which you want to use as default:
Suppose you have
AdministrationHomecontroller.