I am trying to intercept a asp.net web request and based on a lookup replace the page thats going to be rendered to the client.
example: If a request for "/about-us" comes to my web server, i will first see if i have a version of this in the database, otherwise i will revert to flat files. The version I will retrieve from the database will be a .aspx page that has to be rendered and contain web controls and inline serverside script.
What is the best way to go about this?
I have tried overriding the CreateHtmlTextWriter method but this seems to be too late in the process as the TextWriter passed to this method is already instantiated.
I have also tried to Implement my own PageHandlerFactory but this seems to create an instance of Page of which I cannot seem to override its internal setting of the Response.Output stream.
Am i barking up the wrong tree here? what is the best approach to take here?