Question

I have implemented a VirtualPathProvider which fetches a page from a database. This works ok for a simple application consisting of just one markup file (.aspx), its code file (.aspx.vb) and a master page.

Then I have moved code from the code file into a presenter class which interacts with the page and its code behind via an interface.

How do I make my VirtualPathProvider fetch the presenter and interface files from the database to be compiled with the page?

The GetFile method of the VPP is called only for the page, its code-behind and master page. I don't want to use the App_Code directory (which works). If I add Reference page directives for the interface and presenter then the VPP 's GetFile method is called for these but I get the Parser Error Message: "The file 'src' is not a valid here because it doesn't expose a type." If I include the class and interace definitions in the code file for the page it works.

Is there a way to keep them separate?

Was it helpful?

Solution

I could keep them separate in database table and merge contents with code file in the VirtualPathProvider when GetFile is called by ASP.Net for the code file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top