I would like to implement a ASP.NET MVC View Engine to perform some pre-processing of the original .aspx/.ascx. file. Then, I want to pass the result to the default view engine (typically the WebForm View Engine).
This means, the default View Engine shouldn’t read this file from disk, since this is not yet processed. Instead, i would want the View Engine to read the input from an input stream.
Is this possible? Should i create a new file extension mapped to this pre-processing view engine?
thx
You going to need to create a custom viewengine that reads the aspx files, modifies them as you need, then passes them to some build provider. The
WebFormsViewEngineuses theSystem.Web.Complilation.BuildManagerclass to build the aspx files. The problem you will have is that theBuildManageronly accepts virtual paths, it doesn’t accept streams or strings. This means that you will probably have to make your own build manager as well. Look around in theSystem.Web.Compilcationnamespace to see if you can find anything that may help out. Below are a few sources that may point you in the right direction.This might be a useful resource.