返回首页

Response.Clear();

            Response.Buffer = true;

            Response.AddHeader("content-disposition",

                               "attachment; filename=" + Session["NwAccountName"] + "_" + DateTime.Now +

                               "_DestinationUrlsReport.xls");

            Response.Charset = "";

            Response.ContentType = "application/vnd.ms-excel";

            var sw = new StringWriter();

            var hw = new HtmlTextWriter(sw);

            GridView1.AllowPaging = false;

            GridView1.DataBind();

            GridView1.RenderControl(hw);

            Response.Output.Write(sw.ToString());

            Response.Flush();

            Response.End();
| anuj_87

回答

评论会员:p 时间:2