Solved

ASP.net Open the Save Dialog

Posted on 2014-10-28
2
86 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
Comment Utility
Put the Response.Clear() at the beginning
0
 

Author Closing Comment

by:smithmrk
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

8 Experts available now in Live!

Get 1:1 Help Now