HttpModule/HttpHandler and condtional Response

  • Thread starter Thread starter BK
  • Start date Start date
B

BK

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
 
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....:-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top