Solved

ASP.net Open the Save Dialog

Posted on 2014-10-28
2
92 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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