I've been trying to fix this for two hours straight and I can't figure it out.
onclick = "location='exceltest.asp?vanjaar=<%=vanjaar%>&vanmaand=<%=vanmaand%>&vandag=<%=vandag%>&totjaar=<%=totjaar%>&totmaand=<%=totmaand%>&totdag=<%=totdag%>'"
That line of code is in an < input type="button" /> attribute. The button links to a page where an Excel download should be triggered. The values in the URL are from- and to-date-parts. (year, month, day)
this:
onclick = "location='exceltest.asp?fromdate=<%=fromdate%>&todate=<%=todate%>'" />
does not work, because somehow IE7 reads the date (eg. 2008/1/1) wrong. Something to do with the slashes I think.
But when I try to click the button in IE and thus download the generated file, Internet explorer tries do download the file
exceltest.asp?vanjaar=2008vanmaand=1vandag=1totjaar=2008totmaand=2totdag=1
instead of the excel file I want.
FF offers to download the excelfile, but gives (in that excelfile) an overview of an htmlpage with an errormessage telling me my query is wrong (Item cannot be found in the collection corresponding to the requested name or ordinal.) But that CAN'T be, I'm using that exact same query elsewhere, using the same (but restarted) connection.
This is the bit of code I use to instantiate the download of the file:
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "attachment; filename=overicht.xls"
There might actually being to things going on here, but I am most insterested in why IE wants to download the asp page and FF offers the right download.