Classic ASP - how to export data from modal window
I have this modal dialog window that shows the first 5 rows of a record set.
There is an Export ALL button so the user doesn't have to scroll through each page to see the result but can just export to a comma-delimited file. The file is .txt (not .csv not .xsl) that just looks as simple as:
I thought it is an easy thing, but it feels like it is COMPLETELY IMPOSSIBLE!!
I have no idea how to do that. I'm on a modal window so if I do a <form> and post the action to itself, then a new blank window comes up. But if I don't do a post, I don't know how I can hit this button and then the server can run the data retrieval and send the result back to the client....
All I want to do is that, as soon as the user hits this button, there will be a File SaveAs dialog box comes up that lets the user decide the name and the location, and then the txt file gets downloaded there. NOTE: since the grid shows only the first five rows, I have to call my data retreival process (stored proc in this case) to specify retrieving all rows, so some data exported is not currently in the grid.
Can you suggest how I should go proceed?
Thanks a lot