Posted on: 7/19/2013 10:41:37 PM | Views : 209

I'm trying to figure out how to get the a File Save As type dialog box to appear in my ASP.Net 4.0 AJAX application.  I've done much reading on the subject but can't find any conclusive answers.  This is the best I've come up with so far but when I press the button that calls this code, the code runs but no dialog box appears.
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; try { string fileName = "BugData.txt"; string filePath = Path.GetTempPath(); response.ClearContent(); response.Clear(); response.ContentType = "text/plain"; response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ";"); response.TransmitFile(filePath + fileName); } catch(Exception ex) { } finally { response.Flush(); response.End(); }< ...

Go to the complete details ...