Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send a text file to client...
Message
From
19/05/2004 09:36:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Send a text file to client...
Miscellaneous
Thread ID:
00905251
Message ID:
00905251
Views:
112
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
Next
Reply
Map
View

Click here to load this message in the networking platform