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();

 

posted on 2013-07-03 14:47  努力实现目标  阅读(1457)  评论(1编辑  收藏  举报