I am writing a HTTPModule and all I want to do is trace the size of the page
the client is requesting and that the web server is going to return. I
tried the following code but it throws an exception saying it is
unsupported..... Any help would be greatly appreciated....thanks.
void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication myHttpApplication =
(HttpApplication)sender;
Stream baseStream = myHttpApplication.Response.Filter;
orginalSize = baseStream.Length; //exception here!
{
and this.... both fail
void context_EndRequest(object sender, EventArgs e)
{
HttpApplication myHttpApplication = (HttpApplication)sender;
long orginalSize = 0;
long compressedSize = 0;
orginalSize =
myHttpApplication.Context.Response.OutputStream.Le ngth; //fails
}