473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2808
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.