Click here to Skip to main content
15,672,088 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I wanna one help i developed one website in that one page is containing some data and when click on the download button that action is redirected to another page by using, in that i have designed one layout and that content can be downloaded without saving the save button in browser. Actually it is downloaded when click on the save button in browser. but i don't want like that, the page automatically download in my machine. can any one help me please. Advancely thank you.
ZurdoDev 4-Mar-15 8:42am    
What is your question?

Your question is unclear but as per your description I'can guess and provide you following two possible solutions.

1. Use Anchor tag and give the filepath to href attribute of anchor tag, like this:
<a href="yourfilepathfromyourserver.pdf" target="_blank" alt="Download">Download Pdf</a>

Here, target="_blank" is the key to open file in new window.

2. If you want to export data from gridview with existing format[^], best practice is to provide a button onclick event.
Share this answer
Here is the third party tool for you,[^]
Share this answer
If you want the file to automatically download to the client then you can't do that for security reasons.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900