Solved

ASP.net Open the Save Dialog

Posted on 2014-10-28
2
88 Views
Last Modified: 2014-10-28
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
0
Comment
Question by:smithmrk
2 Comments
 
LVL 17

Accepted Solution

by:
OriNetworks earned 500 total points
ID: 40409390
Put the Response.Clear() at the beginning
0
 

Author Closing Comment

by:smithmrk
ID: 40409407
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now