asp.net 保存word 保存代码已经写好了 点击保存的时候样式有点乱我页面全用的table,样式也定在页面里面了,就是保存后页面JS动态赋值的保存不上,有什么办法获得JS动态值的值吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 页面有一部分文字是根据数据的编号来对应JS中的中文然后显示中文信息,比如:数据0100是数据 JS中0100是北京,那就页面就显示北京,当我点保存word的时候显示的还是0100,也就是说JS赋的值是保存不上的。 先替换好了在保存/// <summary> /// 将Web控件导出 /// </summary> /// <param name="source">控件实例</param> /// <param name="type">类型:Excel或Word</param> public void ExpertControl(System.Web.UI.Control source, DocumentType type) { //设置Http的头信息,编码格式 if (type == DocumentType.Excel) { //Excel Response.AppendHeader("Content-Disposition","attachment;filename=result.xls"); Response.ContentType = "application/ms-excel"; } else if (type == DocumentType.Word) { //Word Response.AppendHeader("Content-Disposition","attachment;filename=result.doc"); Response.ContentType = "application/ms-word"; } Response.Charset = "UTF-8"; Response.ContentEncoding = System.Text.Encoding.UTF8; //关闭控件的视图状态 source.Page.EnableViewState =false; //初始化HtmlWriter System.IO.StringWriter writer = new System.IO.StringWriter() ; System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer); source.RenderControl(htmlWriter); //输出 Response.Write(writer.ToString()); Response.End(); } //文档类型 public enum DocumentType { Word, Excel } wxr0323我的写法和你上面写法一样,你说的替换我没办法替换,没有根据 重复数据很多。 分数不多,一帖提两个问题。。。 在线结贴----谁帮我解释一下这个for循环的意思 C#替换word标签 关于多文件上传的问题,求救!! 帮忙解决~送分.ADODB.Recordset 错误 '800a0e79' 对象打开时,操作不被允许 怎样加密cookie????? Asp.net页面问题 高手麻烦指教下 小问题,我做得ASP.NET程序,从一个机器拷贝到另一个机器就不能调试了。 验证控件不响应,郁闷! 我想把一个数组绑到DataGrid上,一开始的时候还能用,后来不知怎么就不能用了?help Ctrl+R,E不管用了。 关于Datagrid 删除行
/// 将Web控件导出
/// </summary>
/// <param name="source">控件实例</param>
/// <param name="type">类型:Excel或Word</param>
public void ExpertControl(System.Web.UI.Control source, DocumentType type)
{
//设置Http的头信息,编码格式
if (type == DocumentType.Excel)
{
//Excel
Response.AppendHeader("Content-Disposition","attachment;filename=result.xls");
Response.ContentType = "application/ms-excel";
}
else if (type == DocumentType.Word)
{
//Word
Response.AppendHeader("Content-Disposition","attachment;filename=result.doc");
Response.ContentType = "application/ms-word";
}
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.UTF8; //关闭控件的视图状态
source.Page.EnableViewState =false; //初始化HtmlWriter
System.IO.StringWriter writer = new System.IO.StringWriter() ;
System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer);
source.RenderControl(htmlWriter); //输出
Response.Write(writer.ToString());
Response.End();
} //文档类型
public enum DocumentType
{
Word,
Excel
}
我的写法和你上面写法一样,你说的替换我没办法替换,没有根据 重复数据很多。