I have a asp.net c# web application. On one of the pages i have a button and when pressed I want it to create a text file with certain text and save it to the users PC. I do not want to save it on the server or anything.
I Currently have this which writes 'test' to a file:
string fileLoc = "filePath";
FileStream fs = null;
fs = File.Create(fileLoc);
StreamWriter sw = new StreamWriter(fileLoc);
sw.WriteLine("test");
fs.Close();
sw.Close();
How do I get it to save to the users computer.
Thanks for the help!.