Response.Clear();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8).ToString());
Response.ContentType = FileType;
this.EnableViewState = false;
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw); repeater2.RenderControl(hw);
string str = hw.InnerWriter.ToString();
Response.Write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">");
Response.Write(sw.ToString());
Response.Write("</body></html>");
Response.End();

asp.net c# repeater或gridview导出EXCEL的详细代码。的更多相关文章

  1. ASP.Net MVC中数据库数据导出Excel,供HTTP下载(转)

    转自http://www.cnblogs.com/hipo/archive/2012/03/13/2394019.html 一.关于下载 一般对下载权限有没有限制,或安全性要求不高的情况下,基于web ...

  2. ASP.Net MVC中数据库数据导出Excel,供HTTP下载

    本文来自:http://www.cnblogs.com/hipo/archive/2012/03/13/2394019.html 一.关于下载 一般对下载权限有没有限制,或安全性要求不高的情况下,基于 ...

  3. 转:ASP.NET MVC 将IList<T>导出Excel文档的泛型类

    /// <summary> /// 提供将泛型集合数据导出Excel文档. /// </summary> /// <typeparam name="T" ...

  4. Asp.net Gridview导出Excel

    前台页面放一个GridView什么的就不说了,要注意的是在 <%@ Page Language="C#" AutoEventWireup="true" C ...

  5. ASP.NET gridview导出excel,防止繁体产生有乱码的方式

    //1.先引用比如 : using System; using System.Collections.Generic; using System.Linq; using System.Web; usi ...

  6. GridView导出Excel的超好样例

    事实上网上有非常多关于Excel的样例,可是不是非常好,他们的代码没有非常全,读的起来还非常晦涩.经过这几天的摸索,最终能够完毕我想要导出报表Excel的效果了.以下是我的效果图. 一.前台的页面图 ...

  7. C#实现GridView导出Excel

    using System.Data;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System. ...

  8. asp.net core web的导入导出excel功能

    这里主要记录下asp.net core web页面上进行导入导出excel的操作. 主要是导入,因为现在使用的很多前端框架(例如kendo ui)本身就有导出的功能. 这里使用到EPPlus.Core ...

  9. asp.net下简单的Epplus导出excel

    引用的命名空间 using System.IO; using OfficeOpenXml; /// <summary> /// 导出excel /// </summary> / ...

随机推荐

  1. spark streaming从指定offset处消费Kafka数据

    spark streaming从指定offset处消费Kafka数据 -- : 770人阅读 评论() 收藏 举报 分类: spark() 原文地址:http://blog.csdn.net/high ...

  2. C语言 · 周期字串

    算法提高 周期字串   时间限制:1.0s   内存限制:256.0MB      问题描述 右右喜欢听故事,但是右右的妈妈总是讲一些“从前有座山,山里有座庙,庙里有个老和尚给小和尚讲故事,讲的什么呢 ...

  3. Android SDK Manager速度慢

    转载自:http://www.cnblogs.com/tc310/archive/2012/12/21/2828450.html Android SDK Manager 无法下载更新,或者更新速度超慢 ...

  4. docker启动报错

    1.报“can’t create unix socket /var/run/docker.sock: is a directory” 这是由于存在容器自动启动 --restart= always导致的 ...

  5. Extjs4.2 Tree使用技巧小结demo

    本案例使用了Ext.Tree.Panel的如下知识点: 1.刷新.重新加载Tree,定位到上次的节点位置 2.Tree的右键操作 3.Extjs4.x Tree获取当前选中的节点 4.新增.修改.删除 ...

  6. linux brctl command not found

    [root@localhost ~]# brctl-bash: brctl: command not found 解决方法: [root@localhost ~]# yum install bridg ...

  7. Python 类的多态

    #python的多态 class Dog(): def eat(self): print("i am dog , eat something . ") class Cat(): d ...

  8. Python 字符串操作函数一

    #-*- coding:utf-8 -*- strword = "i will fly with you , fly on the sky ." #find print(strwo ...

  9. vnc viewer on Ubuntu

    我使用的是putty和SSL/SSH Vnc Viewer.因为刚入坑,也希望小白们能少走弯路,所以本贴写得比较细. 先说说vnc server和 vnc viewer的区别:server用于服务器, ...

  10. String、StringBuffer与StringBuilder 复习回顾总结

    1.三者在执行速度方面的比较:StringBuilder >  StringBuffer  >  String 2.String <(StringBuffer,StringBuild ...