Friday, March 16, 2012

Omitting HTTP headers.

Hi everyone,
How can someone make the ASP.NET preprocessor tonot send the HTTP headers when processing an .aspx page?
The reason for this is that in a project I have to use an #exec SSI toget output from an .aspx page to display in the including webpage.However the HTTP headers are always sent with the page (and thus arealso included in the including webpage - and having headersprinted there just isn't nice).
If I use a simple ASP page this doesnot happen, so therefore I guess it's related to the ASP.NETpreprocessor - I've already tried using the HttpResponse.ClearHeaders()method for both the Init and PreRender events with no success.
Cut-Me-Own-Throat Dibbler
Are you talking about the other HTTP Header (X-Powered-By: ASP.NET)? Ifyou are, then that is an IIS configuration thing. Right click on theweb site in IIS Manager and go to "Properties" and then on the "HTTPHeaders".
Also, are you caching the page on the client side? Sending a HTTPHeader is 'compulsory' - you can't cache on the client without sendingthe header.

No, I am talking about all the HTTP headers.
I do not want the .aspx file to return any headers what-so-ever because its output is being included in a separate file.
As I mentioned above I don't have that problem if I use an ASP page (oreven any other CGI script that doesn't return HTTP headers), howeverthat is not the case with ASP.NET pages - I even tried using a customHttpHandler and still no luck. Is there some property or directive I am missing?

*bump*
Any idea? Anyone? :)

Hi,

Just wondering if a solution to this was ever found. I have a similar problem and will give some background first. (Note that I am a newb to C#/asp.net/mysql etc. etc. so excuse the terminology used).

We are building a web application that uses Flash as it's front end. I am creating the interface in c# to maintain a MySQL database in the background. Parameters are fed into a .aspx page (either in the browser URL or directly from Flash). Getdata uses Querystring to call MySql Stored procedures and then returns a response (using Response.Write) to the browser. Here lies the problem!

Flash expects only a response and no headers. The response in the browser looks fine, but when viewing source (in IE6 view- source), the source contains HTML headers with Meta tags(and no response). I am told by the Flash developer that only the response should appear when View - Source is selected.

I am running the site using IIS, and when testing locally no headers appear, all looks fine. Only when accessing the site externally (i.e. over the web) do the headers appear.

Any help would be appreciated, as mentioned I'm new to this stuff, so hopefully there's a simple/obvious solution that anyone in 4th grade could work out, but it's so far escaped me.


Regards


0 comments:

Post a Comment