472,356 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 software developers and data experts.

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 2775
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
1
by: Justin Haygood | last post by:
I want to use multiple custom headers in the mail() function. I know the basic syntax is mail(recipient, subject, content, optional headers). How would I use like say 3 headers? Also, what would...
2
by: 50295 | last post by:
Hi - I program in C++ but I'm not good with VC++ (yet). I will like to create a custom project for which a specific template or wizard does not exist. Because the program is a console...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
3
by: Alexander Smirnov | last post by:
I'm developing asp.net 2 web application and need to make a custom http handler which sometime must send response with "204 No Content" code. I set HttpResponse.Status="204 No Content"; But asp...
0
by: Nithi Gurusamy | last post by:
I have generated a Web-Service-Proxy (Add Web Reference) within VS. This proxy class is based on WebServicesClientProtocol of WSE 3.0. I want to add some custom HTTP Headers to the envelop before...
0
by: nikhilgargi | last post by:
Requirement: I need to provide printing capability in a C# desktop application that I am developing The documents that need to be printed can be in Rich Text Format (RTF) or HTML. Custom...
0
by: msnews.microsoft.com | last post by:
Hi, I need to create and add custom headers to an ASP.NET 2.0 application. The case is simulation of an SSO-login in our dev/test environment. When I try to add headers I run into the "Not...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.