View Single Post
  #3 (permalink)  
Old January 28th, 2006, 07:58 AM
Rashmi_Dubey Rashmi_Dubey is offline
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I used the following code:

Response.AddHeader("contentdisposition","attachmen t;filename=test1.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWrite(stringWrite);
GridView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();


But RenderControl doen't seem to work with GridView.

Thanks,
Rashmi