tags:

views:

172

answers:

2

My Page_Load calls the following:

pnlProductWrapper.Visible = true;

pnlList2Column.Visible = true;
                rptList2Column.StartIndex = startIndex - 1;
                rptList2Column.NumItems = productsPerPage;
                rptList2Column.DataSource = UseManualProductList() ? lPage.LPageProducts.Values.ToList() : products;
                rptList2Column.DataBind()

on first page load, I see my repeater just fine and its products. But we have a paging control. When clicking next all it does is through a param up in the querystring and we grab it and requery to get more products. So 2nd time around it comes to here again and I debugged and definitely verified that products above is what's being picked and set to the DataSource and after DataBind, rptList2Column has 6 records. But when my page loads, the repeater is not showing up.

Here's some of my mark-up:

<div id="ProductWrapper">
    <asp:Panel ID="pnlList2Column" Visible="false" runat="server">
     <xx:xxRepeater ID="rptList2Column" EnableViewState="false" runat="server">
        <ItemTemplate>
        <td valign="top" align="center" width="150px" style="padding-top:5px">
            <div>
            <a href="<%#xxx(Container.DataItem)%>"><img src="<%#xxx(Container.DataItem)%>" border="0" /></a>
            </div>
            <div>
            <p><a href="<%#(xxx(Container.DataItem))%>"><%#(Container.DataItem).Name%></a></p>
            <p><%#xxx(((xxx)Container.DataItem))%></p>                                
            </div>                                
        </td>
        </ItemTemplate>
    </xxx:xxx>                 
    </asp:Panel>
</div>

this is a custom repeater and I have 3 on the page, each wrapped with a panel. The first repeater is setup just like this and has no problems. So I don't see why this would not work.

A: 

You might have some problems with the ViewState. Be sure to use!Page.IsPostBack when necassary. Don't store your data in the ViewState AND bind tge repeater on each load.

Zyphrax
Viewstate is disabled on the repeater. Also, I am binding the repeater on each Page_load
CoffeeAddict
The problem is not that I'm not binding every time. It's hitting that binding code EVERY TIME when I refresh my page which is what I want and it's setting the properties to valid values on load.
CoffeeAddict
And you wouldn't want to use !Page.IsPostback because I'm calling this code in Page_Load and I want it to hit that binding every time.
CoffeeAddict
A: 

I had set an index wrong on the repeater. My fault.

CoffeeAddict