I have a web form that employs the following method attached to a button click to export a datagrid to either Excel or Word (by passing the string "xls" or "doc" as the parameter)...
...which works fine normally but when the web site is running over the HTTPS protocol this gives the error "Internet Explorer was not able to open the Internet site. The requested site is either unavailable or cannot be found. Please try again later."
Anyone know if anything can be done about this?
Code:
private void ExportReport(string extension)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" + report_container.ThisReport.Name + "." + extension);
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd." + extension;
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
report_container.report_data_table.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
...which works fine normally but when the web site is running over the HTTPS protocol this gives the error "Internet Explorer was not able to open the Internet site. The requested site is either unavailable or cannot be found. Please try again later."
Anyone know if anything can be done about this?