views:

32

answers:

1

I am writing an ASP.NET application that generates CSV string and returns it using response.write. However, along with the CSV string, the output comes with other information I would like to get rid of (e.g. ASP.NET version, time-stamp) etc. How can I just get the CSV string and nothing else?

A: 

If you are on IIS7 with integrated pipeline mode you should be able to access Headers:

this.Response.Headers.Add() / Remove() etc.
this.Response.ClearHeaders();
this.Response.AddHeader("key", "value");

You're best bet might be to create an HttpModule and return your CSV from it. See answer here HttpApplication.PreSendRequestHeaders

s_hewitt