Z
ZW
Hi there,
I use following code to convert a datagrid data to Excel.
However, if I use IE to access the page, it opens an empty
excel page. If I access it by Netscape, it can open it
with excel (or save it). Does any one have experience to
fix the problem?
//
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-excel";
//Response.ContentType = "application/x-msexcel"; // Same
result
Response.Charset = string.Empty ;
this.EnableViewState = false;
object content = Session["datagrid"];
if (content != null)
{
Response.Write(content.ToString());
Response.End();
}
TIA
ZW
I use following code to convert a datagrid data to Excel.
However, if I use IE to access the page, it opens an empty
excel page. If I access it by Netscape, it can open it
with excel (or save it). Does any one have experience to
fix the problem?
//
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-excel";
//Response.ContentType = "application/x-msexcel"; // Same
result
Response.Charset = string.Empty ;
this.EnableViewState = false;
object content = Session["datagrid"];
if (content != null)
{
Response.Write(content.ToString());
Response.End();
}
TIA
ZW