469,890 Members | 2,316 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Not able view Custom Headers in ASP.NET

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.
Nov 18 '05 #1
3 2701
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.
Nov 18 '05 #2
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 wasdoing, and then grab the header on the next postback. BTW: It looks like ifyou do a Response.Redirect that the appended headers get discarded.

.

Nov 18 '05 #3
"Jacky" <no****@nospam.com> wrote in message
news:0c****************************@phx.gbl...
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
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Google Mike | last post: by
1 post views Thread by Justin Haygood | last post: by
2 posts views Thread by 50295 | last post: by
reply views Thread by Dean Hallman | last post: by
3 posts views Thread by Alexander Smirnov | last post: by
reply views Thread by msnews.microsoft.com | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.