A little background: I am trying to create a lightweight cookieless database-backed user session using a highly striped down ASP.NET implementation. This site audience will be mobile users connecting via celluar networks, so the page sizes need to be very small. I am not using the .NET session, viewstate, etc. and most page contain very few if any server controls.
I want to be able to process the output of a page request so I can modify internal links in the response with my own session information. I have read that there was an ISAPI filter to allow cookieless sessions pre-ASP.NET. That is basically what I want to build, just inside the application.
Has anyone done anything like this? I’m already inheiriting the System.Web.UI.Page class for my page base for other reasons. It seems like I should be able to do something from here.
Thanks
HttpModules can give you complete control over your output, but there are also a couple other things you can do that are a little simpler.
Create a custom Filter for the Response.Filter. More or less you create a Stream that you run everything through before sending it onto the underlying stream letting you make your changes there.
Override the render event for the Page and write all your contents to a string and then make your changes there… for example…
.