I am getting the below error when exporting data to excel from telerik grid(created a user control and using that) only in ie8 for https site.
I am using the below code for export functionality
Response.ContentType = "text/csv";
Response.AddHeader("content-disposition", "attachment; filename=filename.csv");
Response.Write(csv);
Response.End();
Note:cvs is a string builder which contains the data to export.
Please help me to resolve the issue.
Resmi SatishPosted Apr 10, 2013, 1:31 AM
I have tried in that way also however the error existed.
Please find below the code which resolved my issue.
I am using telerikcontrol
gridControl.Page.Response.ClearHeaders();
gridControl.Page.Response.Cache.SetCacheability(HttpCacheability.Private);
gridControl.Page.Response.ContentType = "text/csv;";
gridControl.Page.Response.AppendHeader("content-disposition", "attachment; filename=" + reportInfo.Description.Replace(" ", "_") + ".csv");
gridControl.Page.Response.Write(csv);
gridControl.Page.Response.End();
Note:
gridControl(Name of telerik:RadGrid)
csv is a string builder which contains the data to export
Santhosh Kumar JayaramanPosted Apr 6, 2013, 6:42 AM
??
If it is checked then uncheck and try.
Also if you are using cache anywhere in the page, set to no-cache.