Solved

ASP.net Open the Save Dialog

Posted on 2014-10-28
2
91 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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