Note that there are some explanatory texts on larger screens.

plurals
  1. POHtml helper does not use custom VirtualPathProvider
    primarykey
    data
    text
    <p>I have set up a <code>VirtualPathProvider</code> and it is working fine for direct url calls like <code>http://.../home/index</code> in the address bar.</p> <pre><code>public class HomeController { public ActionResult Index() { // This triggers MyVirtualPathProvider functionallity when called via // the browsers address bar or anchor tag click for that matter. // But it does not trigger MyVirtualPathProvider for 'in-view' calls like // @{ Html.RenderAction("index", "home"); } return View(); } } public class MyVirtualPathProvider : VirtualPathProvider { public override System.Web.Hosting.VirtualFile GetFile(string virtualPath) { // This method gets hit after the Controller call for return View(...); if (MyCondition) return MyVirtualFileHandler.Get(virtualPath); return base.GetFile(virtualPath); } public override bool FileExists(string virtualPath) { // This method gets hit after the Controller call for return View(...); if (MyCondition) return true; return base.FileExists(virtualPath); } } </code></pre> <p>However, I would like this to work for the Html helper too, but right now it is ignoring the <code>VirtualPathProvider</code> for the html helper calls in the view:</p> <pre><code>@{ Html.RenderAction("index", "home"); } </code></pre> <p>Is there a way to solve this problem?</p> <p>In addtion I have an override for the WebViewPage so I would be able to override the initialization for helpers, but I haven't got a clue with what or how.</p> <p><strong>Edit:</strong></p> <p>I have tried this at two computers and, oddly enough, it works on another computer. So the question would actually become:</p> <p>Why does the VirtualPathProvider works on one and fails for 50% on another computer? But then this question would then become somewhat to vague, speculative even. Nonetheless I am not happy with this but it seems I would have to reinstall some things. :(</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.
 

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