1
дорогой все, я попытался код ниже, чтобы сделать экспорт в Excel, но не работает правильно я использовал эту нить link textэкспорт GridView, чтобы преуспеть ошибку
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Patients.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter stw = new StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(gridview1);
this.Controls.Add(form);
form.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();