We are one of the Leading Software Company in Bihar,Noida and Delhi NCR. Currently 200+ Website Running  

Export Gridview Data to Excel


Just Copy and Paste

 

protected void Button2_Click(object sender, System.EventArgs e)

{

Response.Clear();

// Dim FileName As String = TextBox6.Text

Response.AddHeader("content-disposition", "attachment;filename=Members.xls");

 

Response.Charset = "";

 

// If you want the option to open the Excel file without saving than 

 

// comment out the line below 

 

// Response.Cache.SetCacheability(HttpCacheability.No  Cache);

 

Response.ContentType = "application/Members.xls";

 

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

 

System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

 

GridView1.RenderControl(htmlWrite);

 

Response.Write(stringWrite.ToString());

 

Response.End();

 

}

 

public override void VerifyRenderingInServerForm(Control control)

{

// Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time.

}

Website Designing in Patna Bihar Noida Delhi NCR,Web Development, SEO Service, Web Hosting Patna Bihar Noida Delhi NCR, web designing company in Patna Bihar Noida Delhi NCR ,India Web Design Company in Patna Bihar Noida Delhi NCR, Website Development Patna Bihar Noida Delhi NCR, Software Development in Patna Bihar Noida Delhi NCR,SEO Company in Patna Bihar Noida Delhi NCR, Web Promotion company in Patna Bihar Noida Delhi NCR, best website development company in Patna Bihar Noida Delhi NCR, Logo Design in Patna Bihar Noida Delhi NCR, Website development company in Patna Bihar Noida Delhi NCR, Customised software development in Patna Bihar Noida Delhi NCR.
Copyrights © 2014-2015 Reserved to XMICROSYSTEM GROUP