473,385 Members | 1,606 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,385 software developers and data experts.

HttpModule preventing execution of HttpHandlers

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 an HttpHandler installed to render
Excel files as HTML, or to render TIFFs to JPEGs, etc.

The HttpModules are used for Uri handling, so that a request for a resource
like;

http://somesite.com/file/sales_data.xls

....gets converted to something internally meaningful, like a database query
or a retrieval action from a third-party content management system.

Unfortunately with the HttpModule installed, the HttpHandlers never run; so
even with an HttpHandler registered to handle the ".xls" file type, the raw
Excel file is returned to the client rather than the HttpHandler-generated
content.

Is there something that I need to do in the HttpHandler to ensure that the
normal chain of processing continues? Or could Uri-rewriting be confusing
the situation, such that a conversion of;

http://somesite.com/file/sales_data.xls

....to...

http://somesite.com/getfile.aspx?FileID=103

....would prevent the matchup of the request to the defined HttpHandlers?

My best guess is that I'm doing something incorrectly in the HttpModule
that's gumming up the works, so to speak.

If not, I'm fine with invoking the HttpHandlers directly if needed. I
assume that I can read the Web.config file, determine which handler applies
based on the file extension, and invoke the handler... but in this approach
I'm uncertain how to mimic the webserver's call to the handler.

I'd greatly appreciate some advice on either approach.

/// Michael Wells

Nov 19 '05 #1
3 2100
"MWells" <outbound__at_sygnal.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
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 an HttpHandler installed to render
Excel files as HTML, or to render TIFFs to JPEGs, etc.

The HttpModules are used for Uri handling, so that a request for a
resource
like;

http://somesite.com/file/sales_data.xls

...gets converted to something internally meaningful, like a database
query
or a retrieval action from a third-party content management system.

Unfortunately with the HttpModule installed, the HttpHandlers never run;
so
even with an HttpHandler registered to handle the ".xls" file type, the
raw
Excel file is returned to the client rather than the HttpHandler-generated
content.

Is there something that I need to do in the HttpHandler to ensure that the
normal chain of processing continues? Or could Uri-rewriting be confusing
the situation, such that a conversion of;

http://somesite.com/file/sales_data.xls

...to...

http://somesite.com/getfile.aspx?FileID=103

...would prevent the matchup of the request to the defined HttpHandlers?


Yes. Try not changing the extension and see what happens.

John Saunders
Nov 19 '05 #2
I'm not certain how to execute the ASPX page without actually calling it.
Are you saying that I have to put my retrieve-data code in the HttpModule
directly, rather than doing a Url rewrite to a separate ASPX page?

Alternatively, would doing a Server.Transfer instead of Url rewriting make a
difference?
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ub*************@TK2MSFTNGP11.phx.gbl...
"MWells" <outbound__at_sygnal.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
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 an HttpHandler installed to render
Excel files as HTML, or to render TIFFs to JPEGs, etc.

The HttpModules are used for Uri handling, so that a request for a
resource
like;

http://somesite.com/file/sales_data.xls

...gets converted to something internally meaningful, like a database
query
or a retrieval action from a third-party content management system.

Unfortunately with the HttpModule installed, the HttpHandlers never run;
so
even with an HttpHandler registered to handle the ".xls" file type, the
raw
Excel file is returned to the client rather than the HttpHandler-generated content.

Is there something that I need to do in the HttpHandler to ensure that the normal chain of processing continues? Or could Uri-rewriting be confusing the situation, such that a conversion of;

http://somesite.com/file/sales_data.xls

...to...

http://somesite.com/getfile.aspx?FileID=103

...would prevent the matchup of the request to the defined HttpHandlers?


Yes. Try not changing the extension and see what happens.

John Saunders

Nov 19 '05 #3
"MWells" <outbound__at_sygnal.com> wrote in message
news:er****************@TK2MSFTNGP14.phx.gbl...
I'm not certain how to execute the ASPX page without actually calling it.
Are you saying that I have to put my retrieve-data code in the HttpModule
directly, rather than doing a Url rewrite to a separate ASPX page?

Alternatively, would doing a Server.Transfer instead of Url rewriting make
a
difference?
What I was getting at was that you should try not changing the extension and
then see if it hits your HttpHandler. Not that the handler will _work_, but
see if it gets there.

John Saunders
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ub*************@TK2MSFTNGP11.phx.gbl...
"MWells" <outbound__at_sygnal.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
> 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 an HttpHandler installed to
> render
> Excel files as HTML, or to render TIFFs to JPEGs, etc.
>
> The HttpModules are used for Uri handling, so that a request for a
> resource
> like;
>
> http://somesite.com/file/sales_data.xls
>
> ...gets converted to something internally meaningful, like a database
> query
> or a retrieval action from a third-party content management system.
>
> Unfortunately with the HttpModule installed, the HttpHandlers never
> run;
> so
> even with an HttpHandler registered to handle the ".xls" file type, the
> raw
> Excel file is returned to the client rather than the HttpHandler-generated > content.
>
> Is there something that I need to do in the HttpHandler to ensure that the > normal chain of processing continues? Or could Uri-rewriting be confusing > the situation, such that a conversion of;
>
> http://somesite.com/file/sales_data.xls
>
> ...to...
>
> http://somesite.com/getfile.aspx?FileID=103
>
> ...would prevent the matchup of the request to the defined
> HttpHandlers?


Yes. Try not changing the extension and see what happens.

John Saunders


Nov 19 '05 #4

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

Similar topics

3
by: Bruce B | last post by:
Has anyone else experienced unreliability with HTTPHandler and HTTPModles they've written? What seems to work fine at one time, just seems to stop working at others? Any ideas if this is a...
2
by: Dominik Amon | last post by:
Hi, I'm using HttpModules in my ASP.NET Application (Note, i'm not using HttpHandlers!). Well, it works correctly for the hole application, but i wan't to remove the httpModule for a special...
7
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge...
1
by: ori | last post by:
Hi, I'm facing a problem when trying to continue normal execution flow within a HttpHandler ProcessRequest method. In my application we currently have a custom HttpHandler registered which...
1
by: Anders Bornholm | last post by:
I've added a HttpModule that checks access rights to zip files on my web site. The problem is that HttpContext.Current.Session is always null for zip files (even late in the pipeline - I've tried...
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: ...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
3
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I need to write asynchronous HTTPModule which will sometimes execute long job. I've written it using AddOnBeginRequestAsync but it still executes synchronously - I am checking performance...
0
by: jobs | last post by:
Re: SSRS report viewer Execution ' ' cannot be found (rsExecutionNotFound) Reserved.ReportViewerWebControl.axd Every now and then, my users get this error while in the Reportviewer. Usually,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.