Is it possible to send a text file to a client without needing a seperate page?
Here is what I am doing... I have a button on my web page that calls a web page (Respose.Redirect) passing as parameters the data entered from the first page.
The second page calls the method that returns a string builder with the contents of a text file and writes it to the response stream using code like this:
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + "ACH.TXT" + "\"");
Response.Flush();
Response.Write(sb);
If I try this code from the "Create" button's event handler in the original page the text of the page gets added to the text file. Is there any way to do this without the extra page (which has an empty .aspx file)?
Thanks,
BOb