HttpHandler issue

Discussion in 'ASP .Net' started by Victor, May 23, 2007.

  1. Victor

    Victor Guest

    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
     
    Victor, May 23, 2007
    #1
    1. Advertising

  2. 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.
     
    Steven Cheng[MSFT], May 23, 2007
    #2
    1. Advertising

  3. 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.
     
    Steven Cheng[MSFT], May 25, 2007
    #3
  4. Victor

    Victor Guest

    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

    "Steven Cheng[MSFT]" <> wrote in message
    news:wqx%...
    > 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.
    >
     
    Victor, Jun 1, 2007
    #4
  5. 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.
     
    Steven Cheng[MSFT], Jun 1, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David J. Berman

    Re: HttpHandler for images and browser behavior

    David J. Berman, Jun 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,153
    David J. Berman
    Jun 24, 2003
  2. Nicolas Beunier

    HttpHandler and Session Issue

    Nicolas Beunier, May 28, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    792
    Nicolas Beunier
    May 31, 2004
  3. =?Utf-8?B?TWFuaWtrb3Ro?=

    HttpHandler, User Control image display issue when deployed

    =?Utf-8?B?TWFuaWtrb3Ro?=, Aug 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    571
    =?Utf-8?B?TWFuaWtrb3Ro?=
    Aug 29, 2005
  4. Gais
    Replies:
    0
    Views:
    388
  5. =?Utf-8?B?QnVydA==?=

    IE7 and window.open issue to HttpHandler for downloads

    =?Utf-8?B?QnVydA==?=, May 2, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,493
    leandro.almeida
    Jul 15, 2009
Loading...

Share This Page