Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A simple solution would be to, in your <code>Appication_Start</code> get hold of the appropriate <code>ViewEngine</code> from the <code>ViewEngines.Engines</code> collection and update its <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.virtualpathproviderviewengine.viewlocationformats.aspx"><code>ViewLocationFormats</code></a> array and <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.virtualpathproviderviewengine.partialviewlocationformats.aspx"><code>PartialViewLocationFormats</code></a>. No hackery: it's read/write by default.</p> <pre><code>protected void Application_Start() { ... // Allow looking up views in ~/Features/ directory var razorEngine = ViewEngines.Engines.OfType&lt;RazorViewEngine&gt;().First(); razorEngine.ViewLocationFormats = razorEngine.ViewLocationFormats.Concat(new string[] { "~/Features/{1}/{0}.cshtml" }).ToArray(); ... // also: razorEngine.PartialViewLocationFormats if required } </code></pre> <p>The default one for Razor <a href="https://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Mvc/RazorViewEngine.cs">looks like this</a>:</p> <pre><code>ViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; </code></pre> <p><strong>Note</strong> that you may want to update <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.virtualpathproviderviewengine.partialviewlocationformats.aspx"><code>PartialViewLocationFormats</code></a> also.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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