M. Keith Warren has the right idea, but is using a different method than I would.You can use the Content-Disposition along with the MIME type to force the user to download the file as whatever type you want. If you add an extra header to the page before you send it to the client you can use a plain on ASPX page. Add the “Content-Disposition: attachment; filename=whateveryouwanttocallit.xls” header to your page that is streaming the rendered DataGrid to the client and voila! Response.ContentType = “application/vnd.ms-excel”;Response.AddHeader(“Content-Disposition”, “attachment; filename=spreadsheet.xls”);Instant forced file download. There may be some instances where the user may not want to save the file until they look at the file. This method still works, the user is allowed to select “Open the file from this location” and it will open in the browser just as if it had been streamed to the user.Here is another site with a little more information about Content-Disposition.
