0

我以为这很容易。我已经看过很多关于此的帖子,但没有一个能纠正我的情况。我在更新面板中有一个带有 DataPager 的 ListView 控件。通过寻呼机创建的页码链接,第 1 页显示正常,但后续页面为空白。我的 ListView 是通过定义为 AsyncPostBackTrigger 的按钮更新的。这是我的 ASPX 页面:

<body>
<form id="SearchForm" runat="server">
<asp:HiddenField ID="hdnSeasonSelected" Value="" runat="server" />
<asp:HiddenField ID="hdnCategorySelected" runat="server" />
<asp:HiddenField ID="hdnCartNumItems" Value="0" runat="server" />
<div class="Order">
    <div class="OrderCart">
        <uc1:OrderCart ID="OrderCart" runat="server" />
    </div>
    <div class="OrderSearchResults">
        <h2>
            Search Items<hr />
        </h2>
        Brand:
        <asp:DropDownList ID="ddlBrands" runat="server" AppendDataBoundItems="true" onchange="PopulateBrands();">
            <asp:ListItem Text="Select Brand" Value="0"></asp:ListItem>
        </asp:DropDownList>
        Season:
        <asp:DropDownList ID="ddlSeasons" runat="server" onchange="PopulateCategories();">
            <asp:ListItem Text="Select a Brand to View Seasons" Value="0"></asp:ListItem>
        </asp:DropDownList>
        Category:
        <asp:DropDownList ID="ddlCategories" runat="server" onchange="ddlCategories_SelectedIndexChanged()">
            <asp:ListItem Text="Select a Season to View Categories" Value="0"></asp:ListItem>
        </asp:DropDownList>
        <div class="linespace">
        </div>
        <div>
            Item #:
            <asp:TextBox runat="server" ID="txtItemNumber"></asp:TextBox>
            Item Desc:
            <asp:TextBox runat="server" ID="txtItemDesc"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" OnClientClick="return CheckSearch();" OnClick="btnSearch_Click"
                Text="Button" />
            <input id="btnReset" type="button" value="Reset" onclick="ResetSearch()" /></div>
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ListView ID="lvSearchResults" runat="server" DataSourceID="SqlDataSource1" GroupItemCount="2">
                <LayoutTemplate>
                    <table>
                        <tr>
                            <td>
                                <table border="1px" style="background-color: #F3F3F3" cellpadding="5">
                                    <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <asp:DataPager runat="server" ID="DataPager1" PageSize="4" PagedControlID="lvSearchResults">
                        <Fields>
                            <asp:NumericPagerField ButtonCount="3" PreviousPageText="<--" NextPageText="-->" />
                        </Fields>
                    </asp:DataPager>
                </LayoutTemplate>
                <GroupTemplate>
                    <tr>
                    </tr>
                </GroupTemplate>
                <ItemTemplate>
                    <td>
                        <img src="../Images/test.jpg" />
                    </td>
                    <td id="Td5" valign="top" align="left" runat="server">
                        <b>Item #:</b><asp:Label ID="Label4" runat="server" Text='<%#Eval("full_item_number") %>' />
                        <br />
                        <b>Desc:</b>
                        <asp:Label ID="Label5" runat="server" Text='<%#Eval("item_name") %>' />
                        <br />
                        <b>Color:</b>
                        <asp:Label ID="Label7" runat="server" Text='<%#Eval("color_name") %>' />
                        <a href="">Details</a>&nbsp;&nbsp;&nbsp;<a href="">Season / Categories</a>
                    </td>
                    <td id="Td1" valign="top" align="left" runat="server">
                        <b>Price US$:</b>
                        <asp:Label ID="Label6" runat="server" Text='<%#Eval("program_price") %>' />
                        <input id="Button2" type="button" value="Add to Cart" onclick="AddtoCart('<%#Eval("full_item_number") %>','<%#Eval("item_name") %>');" />
                    </td>
                </ItemTemplate>
            </asp:ListView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" CancelSelectOnNullParameter="false">
    </asp:SqlDataSource>
</div>
</form>

有任何想法吗?在此先感谢...鲍勃

4

1 回答 1

-1

固定...只是有一些糟糕的逻辑!

于 2012-05-05T18:59:17.410 回答