• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 610
  • Last Modified:

prompt user to save asp page as .txt file

I have created a javascript function which would loop through the contents of a table and output the contents as essentially a text csv file which then displays on the browser in the same page.  In other words this function replaces the original display with the new text and displays that to the user.  I'm unsure how to structure the code so that it writes the data into a new tab or page in the browser rather than overwrites the original.  I also need to then prompt the user to download the created page and save as a .txt file.  I'm assuming this process would require asp code but since asp executes prior to javascript I'm not sure how to integrate the two.  Any help is greatly appreciated.
0
drmans
Asked:
drmans
  • 2
  • 2
1 Solution
 
RamanhpCommented:
you may incorporate alert function at the end of ur javascript

eg:  alert("Please save the new created page in a text file");

0
 
drmansAuthor Commented:
I thought about that option but ideally the script would AUTOMATICALLY force a download dialog box.  I've seen it done via asp headers but there would need to be a way to execute the asp code AFTER the javascript has finished executing which I don't think is possible?  
0
 
drmansAuthor Commented:
Let me rephrase the question to simplify a bit...

How would you go about forcing a download dialog box on a dynamically created page?
Ultimately I would like to use some asp code to simply 'copy' the text displayed and offer the user a 'save as' box so that the user doesn't need to right click and save as manually.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now