public override void VerifyRenderingInServerForm(Control control)
{ }
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.Charset = "gb2312";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AppendHeader("content-disposition", "attachment;filename=\"" + System.Web.HttpUtility.UrlEncode("数据导出", System.Text.Encoding.UTF8) + ".xls\"");
Response.ContentType = "Application/ms-excel";
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
this.Label1.RenderControl(oHtmlTextWriter);
this.GridView1.RenderControl(oHtmlTextWriter);
Response.Output.Write(oStringWriter.ToString());
Response.Flush();
Response.End();
} 详细解决方案
Asp.net Gridview 导出到Excel【解决编码乱码有关问题】
热度:107 发布时间:2012-09-11 10:49:03.0
相关解决方案
- word excel pdf在ie浏览器中打开,该如何解决
- 在浏览器中展示word,excel.ppt,pdf等各种文件
- POI 处置 Excel,读取Excel中的格式 如表格框,背景色
- jxls 怎么导出图片到 excel 中
- poi excel 如何合并单元格?
- 用Java EXCEL API 是否能从Excel中导出表格,该如何处理
- java excel 問題 求大神 速解解决方案
- java 处理 excel 相关有关问题
- C# Web Excel导入文件名称选择 &GridView 控件,该如何解决
- DevExpress.XtraGrid.Views.Grid.GridView 怎么自增新行
- dev gridView 依据列的不同值,给每行的同一列设置不同的颜色,字体设置成别的颜色
- 分页控件AspNetPager+GridView+xml怎么实现分页?
- GridView+联接水晶报表解决办法
- 小弟我用水晶报表9新建一个报表,采用PULL模式,在创建新的连接中选用access/Excel(DAO),选择数据库之后,总是弹出对话框说登录失败
- [Crystal Reports]在ASP.net web中导出 有关问题[Excel、Word、PDF]
- Excel 图表解决方法
- gridview 即刻更新提醒显示
- GridView,剔除的是索引值而不是主键
- 求教为 GridView 赋值解决办法
- gridview 行状态DataControlRowState有关问题
- 使用FlashPrinter将word,excel,pdf转换成swf失败的有关问题
- DataSet 读写 Excel.该怎么处理
- 在<asp:GridView 中,该如何解决
- asp.net gridview 分页有关问题
- excel 导入数据到sql。就出有关问题了
- GridView 无数据展示表头及固定行并且行双击时能编辑
- gridview 从新绑定数据后,check选中状态丢失
- 怎的把Microsoft.Office.Interop.Excel.ApplicationClass excel创建的文件保存到数据流中
- asp.net上载并保存 excel 格式表格数据
- GridView 怎么设置可编辑的CheckBox