I am trying to use the id generated dynamically in asp.net.
<tr id="stdColTr" runat="server">
<td style="font-size:10pt">
<b>Nominal Tol(<asp:Label id="lblStdSize_Unit" runat="server" Text=""></asp:Label>)</b>
</td>
<td>
<asp:Label id="lblStdSize_Toler" runat="server" Text=""></asp:Label>
</td>
</tr>
I have a label in uw.aspx and I am trying to bind the table in it and trying to check whether if value read from database is zero then that particular td should not be visible in that table.
uw.aspx.cs
lblStdSize_Toler.Text = "<table ><thead><tr><th colspan='2'>Diameter</th><th colspan='2'>Tolerance</th></tr></thead><tr><td id='STd1'>From</td><td id='STd2'>To</td><td id='STd3'>+</td><td id='STd4'>-</td></tr>";
while (ReadData.Read())
{
prop_name = ReadData["prop_name"].ToString();
t_property = ReadData["tprop"].ToString();
}
lblStdSize_Unit.Text = ReadData["WD_PROP"].ToString();
if (prop_name == "1sizMin")
{
if (t_property=="0")
{
first td with id SD1 should be hidden.
}
lblStdSize_Toler.Text = lblStdSize_Toler.Text + "<td>" + tdc_property + "</td>";
}
Similarly remaining td checked with t_property if value is "0" then it should be visible false.