J
Jennifer Mathews
' The <table> has two rows.
Dim oTbl As New Table
Dim oTR1 As New TableRow
Dim oTR2 As New TableRow
Dim oTD1 As New TableCell
Dim oTD2 As New TableCell
oTD1.Text = "Whatever One" ' Row 1
oTR1.Controls.Add(oTD1)
oTbl.Controls.Add(oTR1)
oTD2.Text = "Whatever Two" ' Row 2
oTR2.Controls.Add(oTD2)
oTbl.Controls.Add(oTR2)
plchld_One.Controls.Add(oTbl) ' plchld_One is a PlaceHolder control on the page.
' This all works fine.
' -------------------------------
' just changing the code above a bit.
Dim oPanl As New Panel
oPanl.ID = "myPanel"
oPanl.Visible = False
oTD2.Text = "Whatever Two" ' Row 2
oTR2.Controls.Add(oTD2)
oPanl.Controls.Add(oTR2) ' Add a PANEL ( = <div id="myPanel">) generates an error on
the next row.
oTbl.Controls.Add(oPanl) ' <<<<<<< 'Table' cannot have children of type 'Panel'.
' -------------------------------
' So the question is:
' How can I dynamically generate a <div> so I can Hide a row?
<table>
<tr>
<td>Whatever One</td>
</tr>
<div id="myPanel"> << how do I do this in CODE ?
<tr>
<td>Whatever Two</td>
</tr>
</div>
<table>
Thanks
~Jennifer~
Dim oTbl As New Table
Dim oTR1 As New TableRow
Dim oTR2 As New TableRow
Dim oTD1 As New TableCell
Dim oTD2 As New TableCell
oTD1.Text = "Whatever One" ' Row 1
oTR1.Controls.Add(oTD1)
oTbl.Controls.Add(oTR1)
oTD2.Text = "Whatever Two" ' Row 2
oTR2.Controls.Add(oTD2)
oTbl.Controls.Add(oTR2)
plchld_One.Controls.Add(oTbl) ' plchld_One is a PlaceHolder control on the page.
' This all works fine.
' -------------------------------
' just changing the code above a bit.
Dim oPanl As New Panel
oPanl.ID = "myPanel"
oPanl.Visible = False
oTD2.Text = "Whatever Two" ' Row 2
oTR2.Controls.Add(oTD2)
oPanl.Controls.Add(oTR2) ' Add a PANEL ( = <div id="myPanel">) generates an error on
the next row.
oTbl.Controls.Add(oPanl) ' <<<<<<< 'Table' cannot have children of type 'Panel'.
' -------------------------------
' So the question is:
' How can I dynamically generate a <div> so I can Hide a row?
<table>
<tr>
<td>Whatever One</td>
</tr>
<div id="myPanel"> << how do I do this in CODE ?
<tr>
<td>Whatever Two</td>
</tr>
</div>
<table>
Thanks
~Jennifer~