Questions tagged [virtualpathprovider]

VirtualPathProvider is class which provides a set of methods that enable a Web application to retrieve resources from a virtual file system.

VirtualPathProvider is class which provides a set of methods that enable a Web application to retrieve resources from a virtual file system.

117 questions
2
votes
1 answer

Problem with Master Page and Virtual Path Provider

I built a deployable master page into a dll and referenced it in multiple ASP.NET Web Applications using a virtual path provider. The problem I'm having is that this really confuses the source view of my aspx pages. Here is the code inside each of…
chrisjlong
  • 69
  • 2
  • 10
2
votes
1 answer

Cryptic error message from VirtualPathProvider

I have several ASCX files scattered throughout a ASP.NET legacy project. I want to display my ascx files instead which has different markups but still references the old codebehind types. Right now I am getting a pesky error message: Line 10: <%@…
ATL_DEV
  • 9,256
  • 11
  • 60
  • 102
2
votes
0 answers

Retrieve embedded static resources (css/img/etc) using Virtual Path Provider instead of GetWebResourceUrl

I have an asp.net 4.0 webforms website with a CSS stylesheet which I've embedded into a separate assembly. If I load the css using ClientScript.GetWebResourceUrl it loads, but does it with that /WebResource.axd?whateverlongstringofstuff I was hoping…
SelAromDotNet
  • 4,715
  • 5
  • 37
  • 59
2
votes
1 answer

Custom VirtualPathProvider unable to serve URLs ending with a directory

As part of a CMS, I have created a custom VirtualPathProvider which is designed to serve a single file in place of an actual file structure. I have it set up such that if a file actually exists on the server, that file will be served. If the file…
Ender
  • 14,995
  • 8
  • 36
  • 51
2
votes
1 answer

SharePoint - VirtualPathProvider: Register within FeatureReceiver

I'm trying to implement an VirtualPathProvider for SharePoint 2010/2013 (Server and Foundation). So far I've implemented subclasses of System.Web.Hosting.VirtualPathProvider, System.Web.Hosting.VirtualFile and System.Web.Hosting.VirtualDirectory. I…
2
votes
1 answer

Troubleshooting custom VirtualPathProvider

I have just created a customized VirtualPathProvider for my ASP.NET web application. It basically maps all virtual files in "~/Storage" and subdirectories to a directory other than the solution's directory. Code essentials private bool…
2
votes
1 answer

Workaround for Bundling under Virtual Path Providers

I found that under ASP.NET MVC 4 you can't define a bundle of Javascripts or CSSs if their virtual path is managed by a VirtualPathProvider. I mean, if directory "~/Static/" is mapped to a VPP you can't…
usr-local-ΕΨΗΕΛΩΝ
  • 26,101
  • 30
  • 154
  • 305
2
votes
1 answer

Override ASP.NET tilde (~) resolution just for images

I have a large legacy application, and I would like to move all of our images to a CDN. Currently, all of our images reside under the application root itself, so the paths are all like "~/Images/MyImage.jpg." Due to the requirements of our system,…
Brent Miller
  • 111
  • 4
1
vote
2 answers

Caching MVC 3 views fetched from a database

I have a MVC3 application that is serving views stored in a database. I created a VirtualPathProvider and in my GetFile and FileExists methods I go to the database and return the correct thing. So far so good. Now I want to cache the view I return…
Pedro
  • 1,134
  • 11
  • 26
1
vote
1 answer

Can MVC route resolution mechanism be re-configured?

I have implemented custom VirtualPathProvider to serve customizable Views from a DB and when i put a breakpoint on the FileExists method I noticed that the framework does ton of unnecessary (for my project) requests. For example when I make a…
1
vote
1 answer

Is it possible to create a page from a string in ASP.Net?

I can create a page from a file with: Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page)) as Page; How can I instantiate a page from a stream or a string? Thank you.
Santiago Corredoira
  • 47,267
  • 10
  • 52
  • 56
1
vote
2 answers

MVC 3 Add-in View attempting to resolve _ViewStart.cshtml from Add-in

I've been scouring the Internet and learning how to enable an ASP.Net MVC 3 site to use MEF. The idea being to build a modular site, so we can expand features as needed. I have just about every piece of code working, but for some reason, when I'm…
Richard B
  • 1,581
  • 1
  • 15
  • 31
1
vote
1 answer

Static Files not getting routed with IIS the same as they are with Cassini

I have written a custom VirtualPathProvider for ASP.NET MVC 2 that searches assemblies for views and static content so that I can reuse content in multiple sites. It works just fine while using Cassini, but when I deploy the site to a server…
1
vote
1 answer

How to be able to select master pages that are provided by a VirtualPathProvider

We got a lot of intranet websites that share the same design. Therefore we've put the master pages, stylesheet, images and javascripts in a shared assembly. The content is loaded by using: HostingEnvironment.RegisterVirtualPathProvider(new…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
1
vote
1 answer

How can I put a log whenever compiler recompiles my razor view via VirtualPathProvider?

I'm having a bit performance problem here: the code below is part from my custom VirtualPathProvider, I've overwritten the GetCacheKey, and GetCacheDependency so they can cache my razor views properly. public override string GetCacheKey(string…