开发者

controls in asp.net repeater

开发者 https://www.devze.com 2023-04-11 10:13 出处:网络
I have a repeater, which basically has a text box in it and I have implemented a paging function on the repeater, the repeater only shows 25 rows at a time. What I want to do is, get each text box for

I have a repeater, which basically has a text box in it and I have implemented a paging function on the repeater, the repeater only shows 25 rows at a time. What I want to do is, get each text box for each row in the repeater, but at the moment I am only getting the text boxes that are shown on the repeater (the first 25 rows). What can I change in my code to get every single row?

My code is as follows:

foreach (Control control in repeaterSegmentList.Controls)
                {                    
                    foreach (Control innerControl in control.Controls)
                    {
                        if (innerControl.ID != null)
             开发者_JS百科           {                       

                            if (innerControl.ID == "Priority")
                            {
                                ((TextBox)innerControl).Text = txtPrio.Text;
                            }                           
                        }
                    }
                }

thanks in advance.


You probably want to get a reference to the datasource that you bound to your repeater. It's not useful to get references to textboxes that aren't rendered; they wouldn't contain anything.

The data that you bind to your control has all the records, the representation of the data on the screen will only have the controls necessary to show the 25 rows in your page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号