Link to home
Start Free TrialLog in
Avatar of smithmrk
smithmrkFlag for United States of America

asked on

ASP.net Open the Save Dialog

OK, so I have a window that opens using JavaScript:
Dim PopUpScript As String = "<script language='javascript'>" + "window.open('CrystalReportViewer.aspx?SiteID=" & ddl_ProcessSite.SelectedValue & "&BDate=" & txt_StartDate.Text & "&EDate=" & txt_EndDate.Text & "&ReportID=" & rbl_ReportList.SelectedValue & "'" & ",'','width=1000px,height=800px, status=no, resizable=yes, scrollbars=yes, toolbar=no,location=no,menubar=no').focus();</script>"

Page.ClientScript.RegisterStartupScript(Me.GetType(), "PopUpWindow", PopUpScript, False)

BUT when I click one of my buttons on the form to export to Excel...it creates the Excel File but does NOT open the Save/Open Dialog Box:

        'Output the Final String to a File for Download:
        Response.ContentType = "application/ms-excel"
        Response.AppendHeader("Content-Disposition", "attachment; filename=export.xls")
        Response.TransmitFile(Server.MapPath("~/Temp/export.xls"))
        Response.Flush()
        Response.Clear()
        Response.End()

WHY???

Thanks,
Mark
ASKER CERTIFIED SOLUTION
Avatar of OriNetworks
OriNetworks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smithmrk

ASKER

OK, thanks for the tip...but I just found the real issue, it was because I had the button inside an UpdatePanel and needed to register it with the ScriptManager

Mark