Question: how to export html table data to excel in asp.net c#?
Answer: Provide the ID and add runat="server" attribute. <table id="tbl" runat="server" >
Add the following code Response. ContentType = "application/x-msexcel"; Response. AddHeader("Content-Disposition", "attachment; filename=ExcelFile.xls"); Response. ContentEncoding = Encoding.