if (GridView1.Rows.Count > 0)
{
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;
Response.Write("
");
Response.Write("
|
Response.Write("");
Response.Write("
");
gvRes.HeaderStyle.Font.Bold = true;
gvRes.HeaderStyle.BackColor = System.Drawing.Color.Black;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
HtmlForm frm = new HtmlForm();
this.Controls.Add(frm);
frm.Controls.Add(gvRes);
frm.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
This entry was posted
on Thursday, June 10, 2010
and is filed under
Asp.net
.
You can leave a response
and follow any responses to this entry through the
Subscribe to:
Post Comments (Atom)
.