HttpHandler: context.Request.UrlReferrer data is null

Discussion in 'ASP .Net' started by deepak.bhardwaj@gmail.com, Jul 3, 2006.

  1. Guest

    Hi,

    I have implemented the IHttpHandler interface for generating images and
    writing them to response stream in binary format. I use an
    IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
    request to the factory which then instantiates an instance of the
    handler. The response is read by a third party component that then
    displays the image.

    i.e. inside .aspx page:
    -------------------------
    3rdPartyComp.ImageURL =
    "http:\\localhost\ImageGenerator\image.imgr?x=100&y=200";

    (.imgr extension is registered with IIS and is declared in web.config
    httphandler section)

    While debugging this handler, I came across a weird situation where the
    context parameter that gets passed in ProcesRequest module has null
    value for the context.Request.UrlReferrer parameter. Other stuff like
    querystring, sessionstate (implemented IRequiresSessionState in
    handler) etc. do exist though. Needless to say..the HttpInputStream is
    empty when I tried to view its contents.

    I used 'Fiddler' to track requests sent to the handler but that did not
    help much.

    Would appreciate if anyone who faced the same issue could help me
    identify the missing link.

    Thanks
     
    , Jul 3, 2006
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Hi,
    >
    > I have implemented the IHttpHandler interface for generating images and
    > writing them to response stream in binary format. I use an
    > IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
    > request to the factory which then instantiates an instance of the
    > handler. The response is read by a third party component that then
    > displays the image.
    >
    > i.e. inside .aspx page:
    > -------------------------
    > 3rdPartyComp.ImageURL =
    > "http:\\localhost\ImageGenerator\image.imgr?x=100&y=200";
    >
    > (.imgr extension is registered with IIS and is declared in web.config
    > httphandler section)
    >
    > While debugging this handler, I came across a weird situation where the
    > context parameter that gets passed in ProcesRequest module has null
    > value for the context.Request.UrlReferrer parameter. Other stuff like
    > querystring, sessionstate (implemented IRequiresSessionState in
    > handler) etc. do exist though. Needless to say..the HttpInputStream is
    > empty when I tried to view its contents.
    >
    > I used 'Fiddler' to track requests sent to the handler but that did not
    > help much.
    >
    > Would appreciate if anyone who faced the same issue could help me
    > identify the missing link.


    There may not be a missing link. The UrlReferrer comes from an Http header.
    If the header is not provided, then UrlReferrer will be null.

    This is an expected situation.

    John
     
    John Saunders, Jul 7, 2006
    #2
    1. Advertising

  3. Thanks for replying John. Regarding header info, 'Fiddler' showed me that a
    header is being sent but does not have all info. ASP.NET tracing reconfirmed
    this behavior.

    However, I recently discovered that if I have an image tag whose src
    attribute is set to the image httphandler, everything works fine and context
    is not null. It still doesn't work otherwise. So I am still stuck :(

    Thanks

    "John Saunders" wrote:

    > <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I have implemented the IHttpHandler interface for generating images and
    > > writing them to response stream in binary format. I use an
    > > IHttpHandlerFactory to instantiate that handler. A .aspx page sends a
    > > request to the factory which then instantiates an instance of the
    > > handler. The response is read by a third party component that then
    > > displays the image.
    > >
    > > i.e. inside .aspx page:
    > > -------------------------
    > > 3rdPartyComp.ImageURL =
    > > "http:\\localhost\ImageGenerator\image.imgr?x=100&y=200";
    > >
    > > (.imgr extension is registered with IIS and is declared in web.config
    > > httphandler section)
    > >
    > > While debugging this handler, I came across a weird situation where the
    > > context parameter that gets passed in ProcesRequest module has null
    > > value for the context.Request.UrlReferrer parameter. Other stuff like
    > > querystring, sessionstate (implemented IRequiresSessionState in
    > > handler) etc. do exist though. Needless to say..the HttpInputStream is
    > > empty when I tried to view its contents.
    > >
    > > I used 'Fiddler' to track requests sent to the handler but that did not
    > > help much.
    > >
    > > Would appreciate if anyone who faced the same issue could help me
    > > identify the missing link.

    >
    > There may not be a missing link. The UrlReferrer comes from an Http header.
    > If the header is not provided, then UrlReferrer will be null.
    >
    > This is an expected situation.
    >
    > John
    >
    >
    >
     
    =?Utf-8?B?c3VwZXJtYW4=?=, Jul 8, 2006
    #3
    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. Ivan Demkovitch

    Request.UrlReferrer is NULL ???

    Ivan Demkovitch, Jan 30, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    5,627
    Kevin Spencer
    Jan 30, 2004
  2. John

    UrlReferrer null, button click

    John, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    508
    Karunakararao
    Jun 2, 2004
  3. Replies:
    7
    Views:
    14,666
    justingrant
    Oct 18, 2008
  4. Logician

    UrlReferrer Null

    Logician, Sep 18, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,851
    Joerg Jooss
    Sep 18, 2005
  5. =?Utf-8?B?c3VwZXJtYW4=?=

    HttpHandler: context.Request.UrlReferrer is null

    =?Utf-8?B?c3VwZXJtYW4=?=, Jul 3, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    869
    =?Utf-8?B?c3VwZXJtYW4=?=
    Jul 3, 2006
Loading...

Share This Page