asp.net制作网页时候要将table里的label和textbox和table的有颜色的线一并导入到word里
publicoverridevoidVerifyRenderingInServerForm(Controlcontrol){//base.VerifyRenderingI...
public override void VerifyRenderingInServerForm(Control control) { //base.VerifyRenderingInServerForm(control); } private void Export(string FileType, string FileName) { Response.Charset = "GB2312"; Response.ContentEncoding = System.Text.Encoding.UTF7; Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString()); Response.ContentType = FileType; this.EnableViewState = false; StringWriter tw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(tw); //TreeView1.RenderControl(hw); Response.Write(tw.ToString()); Response.End(); } protected void Button1_Click(object sender, EventArgs e) { Export("application/ms-word", "维修.doc"); } 这样怎么不行。。高手帮忙修改下啊 。。。。这样导出word没东西。。空的
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询