Monday, May 12, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Thursday, June 21, 2012

How to export aspx page to excel


protected void Button1_Click(object sender, EventArgs e)
{ 
   string attachment = "attachment; filename=filename.xls";
   Response.ClearContent();
   Response.AddHeader("content-disposition", attachment);
   Response.ContentType = "application/ms-excel";
}

No comments :

Post a Comment

Contact Us

Name

Email *

Message *