How do I make a download page in ASP.NET?
-
I am trying to put a link on the page but when I click on the link, the browser tries to open the file instead of displaying the download dialog box. Any ideas on how to fix this issue? Thanks
-
Answer:
Actually, this is a function of Internet Explorer / Modzilla / Firefox / Opera and not asp or .net at all. There is no way to force a file to download (for security reasons). But, you can have a screen pop up to say open or save. But then it would be up to the user to choose the correct option, and save it in a location other than the default temporary folder which I have had problems letting them choose or just opening the file. Under the internet zone security settings you can set the download options under the advanced settings. I had to roll out a policy change for ie7 for this very reason.
Mike P at Yahoo! Answers Visit the source
Other answers
The proper form for a link is <a href="the link to the file">the text to click</a> If it doesn't work it's because the server thinks it's a file to display or run. Text files, for instance, will just display. HTML files will be sent to the browser as normal web page content. Just Response.Write('<a href='" + yourVariableWithTheLink + "'>" + yourVariableWithTheTextToClickOn + "</a>")
Colanth
Related Q & A:
- How can I make a dynamic web page in PHP?Best solution by Yahoo! Answers
- How do i make a my yahoo but not a home page?Best solution by Yahoo! Answers
- How do I make a Yahoo 360 page?Best solution by Yahoo! Answers
- How can I make a page my home page?Best solution by Yahoo! Answers
- How Do I Make A New Wikipedia Page?Best solution by Web Applications
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.