Not able view Custom Headers in ASP.NET

Discussion in 'ASP .Net' started by Jacky, Nov 21, 2003.

  1. Jacky

    Jacky Guest

    hi,

    I am trying to view the custom headers in an ASP.NET page.
    I am able to view all the standard headers using the
    method Request.Headers.Get(). But if i set a custom header
    using Response.AddHeader("ID","value"), the key or value
    doesnt appear in the Request.Headers collection. What
    could be reason to this problem?

    Does ASP.NET support setting and viewing custom http
    headers. If yes, how do i simulate creating and viewing it
    in my code.

    Thanks in advance.
     
    Jacky, Nov 21, 2003
    #1
    1. Advertising

  2. It won't appear in the request until the response has actually occured,
    meaning you need to append the header, let the page finish whatever it was
    doing, and then grab the header on the next postback. BTW: It looks like if
    you do a Response.Redirect that the appended headers get discarded.
     
    Keith Patrick, Nov 21, 2003
    #2
    1. Advertising

  3. Jacky

    Jacky Guest

    Thanks Keith,

    how do i acheive this, without using a Response.Redirect


    >-----Original Message-----
    >It won't appear in the request until the response has

    actually occured,
    >meaning you need to append the header, let the page

    finish whatever it was
    >doing, and then grab the header on the next postback.

    BTW: It looks like if
    >you do a Response.Redirect that the appended headers get

    discarded.
    >
    >
    >.
    >
     
    Jacky, Nov 21, 2003
    #3
  4. "Jacky" <> wrote in message
    news:0cac01c3b04d$2c4537d0$...
    > hi,
    >
    > I am trying to view the custom headers in an ASP.NET page.
    > I am able to view all the standard headers using the
    > method Request.Headers.Get(). But if i set a custom header
    > using Response.AddHeader("ID","value"), the key or value
    > doesnt appear in the Request.Headers collection. What
    > could be reason to this problem?


    Why would Response.AddHeader affect Request.Headers? Response.AddHeader adds
    a header to the outgoing response. Request.Headers is the headers which were
    sent with the request. These two have nothing to do with each other.

    Perhaps you're confusing headers with cookies?
    --
    John Saunders
    John.Saunders at SurfControl.com
     
    John Saunders, Nov 22, 2003
    #4
    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. =?iso-8859-1?Q?=BF_Mahesh_Kumar?=

    XML FILE as datasource to Grid view..? not able to remove the nodes..?

    =?iso-8859-1?Q?=BF_Mahesh_Kumar?=, Oct 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    532
    =?iso-8859-1?Q?=BF_Mahesh_Kumar?=
    Oct 14, 2005
  2. dont bother
    Replies:
    0
    Views:
    868
    dont bother
    Mar 3, 2004
  3. Phil
    Replies:
    4
    Views:
    734
    Gabriel Genellina
    Jan 17, 2010
  4. Parthiv Joshi
    Replies:
    1
    Views:
    819
    Samuel L Matzen
    Jul 6, 2004
  5. sed_y
    Replies:
    0
    Views:
    1,063
    sed_y
    Feb 15, 2012
Loading...

Share This Page