Note that there are some explanatory texts on larger screens.

plurals
  1. POControl the flow of ViewEngines
    primarykey
    data
    text
    <p>Having a custom view engine installed on my web app:</p> <p>ViewEngines.Engines.Insert(0, new CustomViewEngine1()); ...and the second is the default MVC View Engine for Razor</p> <p>And having the definition of my first view engine:</p> <pre><code>public class CustomViewEngine1: RazorViewEngine { public CustomViewEngine1(): this(null) { } public CustomViewEngine1(IViewPageActivator viewPageActivator) { ViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/../Framework.Web/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", "~/../Framework.Web/Views/Shared/{0}.cshtml" }; MasterLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/../Framework.Web/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", "~/../Framework.Web/Views/Shared/{0}.cshtml" }; PartialViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/../Framework.Web/Views/{1}/{0}.cshtml", "~/Views/Shared/{0}.cshtml", "~/../Framework.Web/Views/Shared/{0}.cshtml" }; FileExtensions = new string[] { "cshtml" }; } protected override IView CreatePartialView (ControllerContext controllerContext, string partialPath) { if (controllerContext.RequestContext.HttpContext.Request.Browser.IsMobileDevice) { return base.CreatePartialView(controllerContext, partialPath); } else { //...What i have to put here in order to let the control to the next route engine in the collection ViewEngines.Engines } } protected override IView CreateView (ControllerContext controllerContext, string viewPath, string masterPath) { if (controllerContext.RequestContext.HttpContext.Request.Browser.IsMobileDevice) { return base.CreateView(controllerContext, viewPath, masterPath); } else { //...What i have to put here in order to let the control to the next route engine in the collection ViewEngines.Engines } } } </code></pre> <p>How could i complete the code (where i have the comments ) in order that if the request has been not made by a mobile device, uses the view engine that comes next in ViewEngines collection? (which is the default MVC Razor View engine).</p> <p>Thanks in advance.</p> <p>Regards.</p> <p>Jose</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. 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