Click here to Skip to main content
14,934,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
By using gridview send data to excel now i want to send textbox value to excel like date then how to do it?
my code:
C#
string attachment = "attachment; filename=InvoiceReport.xls";
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
          //  Response.AddHeader(Txt_fromdates.Text, attachment);
            Response.ContentType = "application/ms-excel";
           
            StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            grd_forSup.RenderControl(htw);
            
            Response.Write(sw.ToString());
            Response.End();
Posted
Updated 7-Oct-13 22:43pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900