ASP .NET - How to Iterate through a repeater ?
        Posted  
        
            by Amokrane
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Amokrane
        
        
        
        Published on 2010-04-04T11:51:21Z
        Indexed on 
            2010/04/04
            11:53 UTC
        
        
        Read the original article
        Hit count: 610
        
Hi,
What I'm trying to do is iterate through a repeater and read some controls values:
   foreach (RepeaterItem iter in TablePanier.Items)
    {
        string guid = ((HiddenField)iter.FindControl("guid")).Value.ToString();
        // nombre exemplaires du livre
        int nbExemplaires = int.Parse(((System.Web.UI.WebControls.TextBox)iter.FindControl("txtNbExemplaires")).Text.ToString());
    }
As you can see, I have a HiddenValue and a TextBox. Unfortunately this isn't working, the values are not read correctly.
What's wrong?
Thank you!
© Stack Overflow or respective owner