Weird repeater problem

Posted by lopkiju on Stack Overflow See other posts from Stack Overflow or by lopkiju
Published on 2010-03-17T20:03:50Z Indexed on 2010/03/17 20:11 UTC
Read the original article Hit count: 318

Filed under:
|

I have a Repeater control in my aspx page:

<asp:Repeater ID="repeater" runat="server" EnableViewState="false">
    <ItemTemplate>
        <%# Eval("someAttribute") %>
    </ItemTemplate>
</asp:Repeater>

On Page_Load I have the following code:

if (String.IsNullOrEmpty((string)Request.QueryString["action"]))
    s.OpenConn("SELECT * FROM someTable;");
else
    s.OpenConn("SELECT * FROM someTable WHERE id=1;");

if (s.Read())
{
    repeater.DataSource = s.GetRead();
    repeater.DataBind();
}

The problem is that when I enter ?action=something, data is not displayed on the page. But if I remove ?action=something, I get all the data.

Am I doing something wrong?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#