ASP.net access controls dynamically

Posted by c11ada on Stack Overflow See other posts from Stack Overflow or by c11ada
Published on 2010-03-22T00:21:39Z Indexed on 2010/03/22 0:31 UTC
Read the original article Hit count: 714

Filed under:
|

hey all,

i have a table which looks similar to this

<asp:TableRow><asp:TableCell>Question 1</asp:TableCell><asp:TableCell ID ="Question1Text"></asp:TableCell></asp:TableRow>
        <asp:TableRow><asp:TableCell ColumnSpan="2">
            <asp:RadioButtonList ID="RadioButtonList1" runat="server"><asp:ListItem>Yes</asp:ListItem><asp:ListItem>No</asp:ListItem>
            </asp:RadioButtonList>
        </asp:TableCell></asp:TableRow>
        <asp:TableRow><asp:TableCell>
            <asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server"></asp:TextBox></asp:TableCell></asp:TableRow>
        <asp:TableRow><asp:TableCell>Question 2</asp:TableCell><asp:TableCell ID ="Question2Text"></asp:TableCell></asp:TableRow>
               <asp:TableRow><asp:TableCell ColumnSpan="2">
            <asp:RadioButtonList ID="RadioButtonList2" runat="server"><asp:ListItem>Yes</asp:ListItem><asp:ListItem>No</asp:ListItem>
            </asp:RadioButtonList>
        </asp:TableCell></asp:TableRow>
        <asp:TableRow><asp:TableCell>
            <asp:TextBox ID="TextBox2" TextMode="MultiLine" runat="server"></asp:TextBox></asp:TableCell></asp:TableRow>

i want to be able to systematically acces table cells with ID's for example

for (int i = 1; i<3 ; i++)
{
// i want to be able to access the table cell with the ID Question1Text then Question2Text and so on 
}

is this even possible ??

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about controls