ListView Control with DataPager in VB.NET

I thought it would be easy. I've seen many posts on this and none correct my scenario. I have a ListView control with a DataPager in an Update Panel. Page 1 displays fine but subsequent pages are blank via the page number links created by the pager. My ListView is updated via a button defined as a AsyncPostBackTrigger. Here's my ASPX Page:

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

Any ideas? Thanks in advance ... Bob

Answers


Fixed ... just had some bad logic!


Need Your Help

Lex/Yacc: using global variables and finding the longest occurance

regex compiler-construction yacc lex flex-lexer

I am trying to find the longest word that is composed of alphabets [ghijklpqrswxyz]..