日期:2014-05-17  浏览次数:20426 次

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>
            &nb