Groups | Blog | Home
all groups > asp.net > may 2005 >

asp.net : HttpModule/HttpHandler and condtional Response


BK
5/27/2005 8:02:42 PM
This is probably a fairly simple question, but I can't seem to get it to
work. I have a situation where I have written an HttpModule to do some post
processing. Everything works beautifully except this last piece.

In the _EndRequest method, I need to modify the Response based upon a
condition. So, I have something like this:

if (condition)
{
Response.Redirect(myURL);
}
else
{
{deliver the originally requested page};
}

How do I get the originally requested resource into the Response buffer? I
have tried a few variations on Response.Flush() but none were successful.

Thanks
BK

BK
5/27/2005 11:21:09 PM
In case anyone else is interested (and it was as simple as I thought), the
answer is:

Response.WriteFile(Path.GetFileName(Request.Path));

Seems obvious, now....:-)

[quoted text, click to view]

AddThis Social Bookmark Button