Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC3 default route to area doesn't search for view inside area
    primarykey
    data
    text
    <p>I set the default route object to a controller ("Beheer") inside an area (also called "Beheer").</p> <p>Like this:</p> <pre><code>routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Beheer", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); </code></pre> <p>It can find that controller and the action fine inside the Area, but it can not find the view because it only looks in these locations:</p> <pre><code>~/Views/Beheer/Index.aspx ~/Views/Beheer/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Beheer/Index.cshtml ~/Views/Beheer/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml </code></pre> <p>While it should be looking in this location:</p> <pre><code>~/Beheer/Views/Beheer/Index.aspx </code></pre> <p>How can I make it search for the view there?</p> <p>I already tried:</p> <pre><code>routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { area = "Beheer", controller = "Beheer", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); </code></pre> <p>And I tried this (with namespaces):</p> <pre><code> routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Beheer", action = "Index", id = UrlParameter.Optional }, // Parameter defaults new[] { "Areas.Beheer" } ); </code></pre> <p>But nothing changes. It enters the correct action in the correct controller but can't find the view.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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