I have a web form with several fields. Depending on user
selection in one combo box, i populate a text box and a
check box in one line. For example if the user selects 2
years, then i show the user two lines with each line
containing 1 text box and 1 check box. I have already put
in 10 lines, using ,<tr> in a table, from which i display
only the required number of <tr> in the code behind
(setting the visible property of controls). Each <tr>
contains a validator for the text box. It works properly,
except that there appears a white space below the 2 <tr>
(if 2 is selected in dropdown). If 10 is selected then all
10 lines <tr> are displayed and no whitespace appears. Any
selection less than 10 leads to the appearance of some
white space below the displayed lines. How do i remove
this white space or make the table dynamic?
<table style="WIDTH: 734px; HEIGHT: 273px" cellSpacing="0"
cellPadding="2" border="0">
<tr>
<td style="WIDTH: 56px; HEIGHT: 23px"><asp:text box
id="txtNumDaysY r1" Runat="server" Width="59px"
ToolTip="Enter Year 1" Visible="False" ></asp:textbox>
</td>
<td style="WIDTH: 38px; HEIGHT: 23px"><asp:Chec kBox
id="chkCage1" runat="server" Width="22px" Text='<font
style="VERTICAL-ALIGN: super" face = "tahoma" size = "0.1"
Color = "#800000">1 </font>' ToolTip="Cage1"
Visible="False" ></asp:CheckBox></td>
<asp:customvali dator id="cvNumDaysYr 1" Runat="server"
Display="Dynami c" ControlToValida te="txtNumDaysY r1"
ErrorMessage="* Number of days cannot be zero for Year 1"
OnServerValidat e="ServerValida te_NumDaysYr1"> </asp:customva
lidator><asp:co mparevalidator id="cmvNumDaysY r1"
Runat="Server" Display="Dynami c"
ControlToValida te="txtNumDaysY r1" Type="Double"
ErrorMessage="* Number of days for year 1 must be a
number" Operator="DataT ypeCheck"></asp:comparevali dator>
</tr>
</table>