0

It's my table:

<asp:Table ID="Table1" runat="server">
    <asp:TableRow>
        <asp:TableCell>number</asp:TableCell>
        <asp:TableCell ID="webCell"></asp:TableCell>
    </asp:TableRow>
</asp:Table>

And it's my server-side code:

For i = 0 To IDsList.Length - 1
    Dim chk As CheckBox = New CheckBox()
    chk.ID = "webCatID" & Convert.ToString(i)
    chk.Text = Convert.ToString(CatsName(i))
    chk.BorderStyle = BorderStyle.None
    chk.CssClass = "checkBox"
    webCell.Controls.Add(chk) 'does not work, it does not webCell
Next

How can I add these check boxes to that cell?

1 Answer 1

1

WebCell is not runat=server, so you cannot reference it in codebehind, add it:

<asp:TableCell ID="webCell" runat="server"></asp:TableCell>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.