exporting datagrid to excel Exception pb

  • Thread starter Thread starter Franck
  • Start date Start date
F

Franck

Hello,
I try to export a datagrid into a excel files,
I've read the help there:

http://www.codeproject.com/aspnet/DAtaGridExportToExcel.asp


I've copied the code
but i receive this exceptionException:

Control 'dgDowntime_ctl02_ctl00' of type 'DataGridLinkButton' must be
placed inside a form tag with runat=server.

event if the datagrid is inside a form with runat=server...


<form id="Form1" method="post" runat="server">
<asp:DataGrid ID="dgDowntime" runat="server" Width="100%" .....

What am i missing?
Thank you!
 
Control your are referring to is probably not working because HTML you
are sending to MS Excel is too specific.

However, you have other free alternatives. For example, ExcelLite Free
is a free .NET component that can read / write both XLS and CSV files.
You can use it in a commercial applications; it is only limited to max
150 rows per sheet. You can download it here:
http://www.gemboxsoftware.com/ExcelLiteFree.htm

Jan
GemBox Software
http://www.gemboxsoftware.com
 
Back
Top