想从Datalist中CheckBox选中的信息导出到Excel表中,怎么实现呢?大侠们,帮帮忙咯....
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server"/>
员工姓名:
<asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
<asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>
</ItemTemplate>
</asp:DataList>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="导出Excel"/>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [FirstName], [LastName] FROM [Employees]">
</asp:SqlDataSource>
</form>
我只在网上参考资料,能把全部的信息导出到Excel表中
牛魔王的故事