replace asp.net Response.Output with my own content
- by WebDude
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:
is 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 containt 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 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.
Amd i barking up the wrong tree here?
what is the best approach to take here?