HttpHandler issue

V

Victor

Hi Guys
I have a problem with my httphandler here. I have several httphandler in my
application. each of them do the different job. but I found sometimes it
really slow down the performance. Is there a way I can specify that one
handler can only be used on certain pages? like httphandler A is used on
page A,B and httphandler B is only used on Page C, D?

Cheers
Victor
 
S

Steven Cheng[MSFT]

Hi Victor,

From your description, what you wonder is how to make each registered
httphandler only serve a certain set of requests/pages, correct?

Based on my understanding, you can consider the following two approaches
here:

1. Since custom httphandler or httpmodule setting can be configured in sub
directory level, you can consider group those pages or requests in to
different child directory of your ASP.NET application and configure the
specific httphandlers in those sub directory's web.config file. Thus,
requests to one sub directory won't be able to use handlers registered in
another sub directory.

#<httpHandlers> Element
http://msdn2.microsoft.com/en-us/library/aa903367(VS.71).aspx


2. Another formal way is use a HttpHandlerFactory, you can register this
factory as handler in your web.config for all the requests. Then, in the
handlerFactory's code, you can check the coming requests(url or other
conditions) and determine which handler to return and process the request.

#How to: Create HTTP Handler Factories
http://msdn2.microsoft.com/en-us/library/ms227439.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hi Victor,

Have you got any further idea on this issue or does the suggestion in my
last reply help you some?
If there is anything else we can help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
V

Victor

Hi steven..Thanks for help..
but I have found i made a stupid mistake. I am using a httpmodule instead of
a httphandler.
What i want to achieve is i have a httpmodule to handle my uploade file
function. But I want this module will only be used when there has something
want to be uploaded to the server. Currently, all pages need to go through
the beginrequest method for the upload httpmodule.
is there anyway I can avoid this?

Thanks
Victor
 
S

Steven Cheng[MSFT]

Thanks for your followup Victor,

So you're actually using the httpmodule. If so, I think this is the
expected behavior. According to ASP.NET server-side processing pipeline
model, each ASP.NET requests will come through those httpmodules registered
in the application(there is no filter to exclude specific requests). If you
do need to use httpmodule and ignore some particular requests(depend on the
url's extension), you should manually check the request url in httpmodule's
code).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top