Hello,
As far as I know there is no easy solution to write directly a file on the client PC. This actually makes sense as it is a security issue, virus writer would love that feature!
What you can do is popup a save as dialog that asks the user to save a file.
Here is an example of how you can do this:
protected void ButtonGetPeople_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment; filename=" + _exportfileName);
Response.AddHeader("content-type", "text/csv");
using (StreamWriter writer = new StreamWriter(Response.OutputStream))
{
writer.WriteLine("Name,DoB,Add1,Add2,Add3,Add4");
}
Response.End();
}
Valery.