Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC3 Using Areas
    text
    copied!<p>I'm having some troubles setting up two Areas in my project, I created both Areas by right clicking my project -> Add -> Area using VS 2010 Professional,</p> <p>The code it generated in the *AreaRegistration.cs files is exactly as I'd expect it.</p> <p><strong>Both my areas have multiple controllers.</strong></p> <p>I've checked my global.asax.cs file and it contains what I'd expect, the following is at the bottom:</p> <blockquote> <pre><code>// Generated code AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); </code></pre> </blockquote> <p>When I change the default generated routing info I can get it to work for a <strong>Single</strong> controller:</p> <pre><code>context.MapRoute( "CommunityCourses_default", "CommunityCourses/{controller}/{action}/{id}", new {controller="NameOfController", action = "Index", id = UrlParameter.Optional } ); </code></pre> <p><strong>The controller="NameOfController"</strong> is what I've tried adding to the generated code, but it only works for a single controller.</p> <p><strong>Edit:</strong> I renamed the namespace of my files to use PROJECTNAME.AREANAME within an area, is this causing issues? I thought it'd simplify my imports in a non-convention-breaking way.</p> <p>What am I missing? I've noticed a lot of problems about areas on SO and tried to follow the answers without success. This issue has bothered eluded me for the majority of the day, any help would be greatly appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload