All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
了解ASP2.0向其它网页传递信息的方法_[Asp.Net教程]
asp.net2.0导出pdf文件完美解决方案_[Asp.Net教程]
在,ASP.NET,中用匿名委托简单模拟,AOP,做异常和日志处理_.net资料_编程技术
SQL,Server如何得详细错误处理信息_[SQL,Server教程]
PHP脚本的8个技巧(1)把PHP安装为Apache DSO_[PHP教程]
session简要用法实例_[Asp.Net教程]
delphiGDI图像编程
C++面向对象基本概念解析[二]
PHP入门:define的使用_php资料_编程技术
SQL,Server数据库和XML标识语言的集成_[SQL,Server教程]
Reading number is top 10 pictures
什么叫国家
Exquisite decoration is not paying too much2
Beauty ZhiHuiLin2
Fan bingbing black wings for platform and DanLuoWang believes beauty2
More attractive than sora aoi2
全球十大灵异酒店
Chinese paper-cut grilles art appreciation1
The world first motorcycle will be auctioned for 21000 pounds
男人帮杂志里的惹火性感美女2
赵惟依写真1
Download software ranking
Tram sex maniac 2 (H) rar bag14
Kung fu panda - the secret of the teacher
Unix video tutorial14
Tram sex maniac 2 (H) rar bag6
Eclipse 4.2.2 For Win64
Unix video tutorial12
仙剑奇侠传98版歌曲
网络管理员第三版
Tram sex maniac 2 (H) rar bag1
美女写真3
delv published in(发表于) 2014/1/23 3:12:57 Edit(编辑)
GridView实用示例源码(可以导出Excel)_[Asp.Net教程]

GridView实用示例源码(可以导出Excel)_[Asp.Net教程]

GridView实用示例源码(可以导出Excel)_[Asp.Net教程]

最近在学GridView,但是找了很多教程但是都没有实例,特别是导出Excel的
,于是就自己整理写了一个,给象我一样的菜鸟们,如果正在学Asp.net2.0的同僚们可以看看阿!高手不要见笑哦!

GridView实用源码(可以导出Excel) VS2005中GridView的自定义分页,单选、多选、排序、自增列及可以导出Excel的简单应用源码多选时,只有全部选中时“多选”才选中


导出Excel部分的源码
//导出到Execl
protected void Button3_Click(object sender, EventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}


下载地址


来源:http://liudao.cnblogs.com/







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.