473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

HttpModule/HttpHandler and condtional Response

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
Nov 19 '05 #1
1 1208
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....:-)

"BK" <no*****@hotmail.com> wrote in message
news:uE**************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Rilling | last post by:
Can an HttpHandler or HttpModule be invoked on non-ASP.NET pages such as images or ASP or HTML pages? Can I trap a request for those pages? If not, how might I trap those requests?
0
by: Bruce B | last post by:
Hi group, I'm experiencing some extreme weirdness over the last week with IIS related to it's Mappings and how .NET is behaving. I can't explain the behavior as it seems very random. Our...
3
by: Michael Iantosca | last post by:
I have a custom attribute that I attach to certain pages in my application and I want to inspect each page request as it is made to see if the custom attribute is attached to the underlying page...
3
by: MWells | last post by:
I'm having an issue getting my HttpHandlers and HttpModules to play together nicely. My HttpHandlers take special document types (defined by extension) and process them specially. I might have...
6
by: Steve | last post by:
Hi there, I'm trying to create a new website that will have a common aspx file serve as a template. I want all other pages to use this file and 'inject' their own content i.e. user controls,...
0
by: Mike Schilling | last post by:
(I've asked this on the C# newsgroup; I'm hoping someone over here might have an idea.) We have a C# application running under ASP.NET. It wasn't written using any VS.NET magic; all of the call...
0
by: tshad | last post by:
I am trying to get an HttpHandler I found on the Web to work. It is called FreeText. It allows fancy handling of a Textbox. This program is just a dll that you set up as an HttpHandler: ...
1
by: Max | last post by:
I have my HTTPModule or HTTPHandler registered to process all file types (*). I have IIS configured to pass all requests to ASP.NET for this virtual directory. In some cases depending on the...
7
by: Tomasz | last post by:
Hello Developers, I have an interesting problem. How, or when can I access SessionState from HttpModule? It seems that session state is only available when *.aspx page is requested. It is not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.