ListView1 FindControl未将对象实例化解决思路
ListView1 FindControl未将对象实例化
前台代码
前台代码
<asp:ListView ID="ListView1" runat="server" DataKeyNames="日期"
DataSourceID="SqlDataSource1" onitemcommand="ListView1_ItemCommand">
<AlternatingItemTemplate>
<table style="width: 100%;">
<tr>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="select"><%# Eval("标题") %></asp:LinkButton>
</td>
<td style="width: 300px; height: 30px">
<%# Eval("日期") %>
</td>
</tr>
</table>
</AlternatingItemTemplate>
<EmptyDataTemplate>
未返回数据。
</EmptyDataTemplate>
<ItemSeparatorTemplate></ItemSeparatorTemplate>
<ItemTemplate>
<table style="width: 100%;">
<tr>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="select"><%# Eval("标题") %></asp:LinkButton>
</td>
<td style="width: 300px; height: 30px">
<%# Eval("日期") %>
</td>
</tr>
</table>
</ItemTemplate>
<LayoutTemplate>
<ul ID="itemPlaceholderContainer" runat="server" style="">
<li runat="server" id="itemPlaceholder" />
</ul>
<div style="">
<asp:DataPager ID="DataPager1" runat="server">
<Fields>