-
Download Excel file link
Hi,
I have code that works to create an Excel file of data presented on my .asp page.
The code automatically downloads the file when I access the page. How do it get it to work only when a link is clicked.
The code I am using is
Code:
<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "filename=excelfile.xls"
%>
Thanks
-
I'm not an ASP user but I would imagine you can write the file download code into a function and call it onclick.
Try http://stackoverflow.com/questions/1...n-as-hyperlink
Or how about creating a link that points to a file (e.g. 'download.asp'), and then put only your file download code into that file.
-
Great, that's given me an idea and I have it working now
Thank you