Getting all http headers

A

Arthur Yousif

Hi,
I'm just starting out on ASP.NET, although I'm not new to
programming. I'm in a crunch and have been all over the
documentation and MSDN and searching this newsgroup with
no luck finding the info I'm looking for.

Basically, I'm creating my own custom header and using
Response.AppendHeader("MyHeader", myVal) and then I've
tried calling my test page using Response.Redirect,
Response.Write, and Response.BinaryWrite, which all work,
however, on my test page when I read all the Headers from
the Request.Headers collection, I never see my custom
headers.

Any help would be greatly appreciated. Am I even doing
this correctly? I know I can create a form with hidden
fields and post the page, but I'm wanting to include this
in the header in this case. Thank you.

Arthur
 
A

Arthur Yousif

Thanks Michal. I'm curious, the following code works with Response though.

Response.AppendHeader("content-disposition",
"attachment; filename=myfile.pdf");

Response.ContentType = "application/octet-inputStream";

When I do a Response.BinaryWrite(myBinaryBuffer) the browser correctly
handles it and opens the Save dialog. Also, even though you can append
headers to a Response object, I don't see it having a Headers collection
like the Request object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top