priyavelan
March 18th, 2010, 05:10 AM
Hi,
Export to XXX.csv through asp.net application is working for most of us. But for 1 user it is not working properly. Instead of the file name XXX.csv, the download window shows ABC.aspx and the type of the file is recognized as unknown.
I am using the below code to export the data from the grid using a link button click...
File Name:- ABC.aspx.cs
private void lbtExport_Click(object sender, System.EventArgs e)
{
if(dgData.Items.Count>0)
ExportToCSV();
}
#endregion
#region Export to CSV
private void ExportToCSV()
{
string strData = Export();
byte[] data = System.Text.ASCIIEncoding.ASCII.GetBytes(strData);
Response.Clear();
Response.AddHeader("Content-Type", "application/Excel");
Response.AddHeader("Content-Disposition", "inline;filename=XXX.csv");
Response.BinaryWrite(data);
Response.End();
}
#endregion
I tried the below steps already...
1. Delete the IE Browser cache
2. Close & re-open the IE browser
3. Restart the client PC
...even after I tried the above, I can not able to fix the issue.
If any of you guys know how to fix the issue, please help me...
Thanks
Priya
Export to XXX.csv through asp.net application is working for most of us. But for 1 user it is not working properly. Instead of the file name XXX.csv, the download window shows ABC.aspx and the type of the file is recognized as unknown.
I am using the below code to export the data from the grid using a link button click...
File Name:- ABC.aspx.cs
private void lbtExport_Click(object sender, System.EventArgs e)
{
if(dgData.Items.Count>0)
ExportToCSV();
}
#endregion
#region Export to CSV
private void ExportToCSV()
{
string strData = Export();
byte[] data = System.Text.ASCIIEncoding.ASCII.GetBytes(strData);
Response.Clear();
Response.AddHeader("Content-Type", "application/Excel");
Response.AddHeader("Content-Disposition", "inline;filename=XXX.csv");
Response.BinaryWrite(data);
Response.End();
}
#endregion
I tried the below steps already...
1. Delete the IE Browser cache
2. Close & re-open the IE browser
3. Restart the client PC
...even after I tried the above, I can not able to fix the issue.
If any of you guys know how to fix the issue, please help me...
Thanks
Priya