易截截图软件、单文件、免安装、纯绿色、仅160KB

求GridView导出到excel,javascript源码?

求GridView导出到excel,javascript源码?xiexie
C# code:
public static void ExportExcel(ref System.Web.UI.WebControls.GridView gv, string strFileName)
{
strFileName = System.Web.HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8);


System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Buffer = true;
System.Web.HttpContext.Current.Response.Charset = "UTF-8";
System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "online; filename=" + strFileName + ".xls");
System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
System.Web.HttpContext.Current.Response.ContentType = "application/ms-excel";
//System.Web.HttpContext.Current.EnableViewState = false;
System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("zh-CN", true);
System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad);
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);


oHtmlTextWriter.Write("<style>.txt{MSO-NUMBER-FORMAT:\\@}</style>");
gv.RenderContro


相关问答:

javaScript 悬停浮动层定位

如何实现当鼠标悬停控件上时,出现该控件的尾部显示对应的层,鼠标移动到该层上进行相应的操作,当鼠标移除时(不在控件上也不在层上)层隐藏,

http://topic.csdn.net/u/20090830/23/5e5ded07-7216-46c2-9712- ......

如何用javascript在页面中动态更新某一块的内容?

我的源文件如下:
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
    {
     
    ......

这段JavaScript代码为什么无法执行 - .NET技术 / C#

以下是一段JavsScript脚本,但运行时总会产生 “Microsoft JScript 运行时错误: 'null' 为空或不是对象”异常,大家帮看一下。 
<form id="form1" runat="server">
  < ......

关于JavaScript的prototype和instanceof

JScript code:

function C1(){}
function C2(){}
C2.prototype=new C1();
function C3(){}
C3.prototype=new C2();
var obj=new C3();
function C4(){}
C3.prototype=new C4();
alert(obj insta ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号