Problem with white space on page

A

Amar

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:textbox
id="txtNumDaysYr1" Runat="server" Width="59px"
ToolTip="Enter Year 1" Visible="False"></asp:textbox>
</td>
<td style="WIDTH: 38px; HEIGHT: 23px"><asp:CheckBox
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:customvalidator id="cvNumDaysYr1" Runat="server"
Display="Dynamic" ControlToValidate="txtNumDaysYr1"
ErrorMessage="* Number of days cannot be zero for Year 1"
OnServerValidate="ServerValidate_NumDaysYr1"></asp:customva
lidator><asp:comparevalidator id="cmvNumDaysYr1"
Runat="Server" Display="Dynamic"
ControlToValidate="txtNumDaysYr1" Type="Double"
ErrorMessage="* Number of days for year 1 must be a
number" Operator="DataTypeCheck"></asp:comparevalidator>
</tr>
</table>
 
P

Prasanna Rajupeta

Hello Amar,

To solve this problem,

I think this could help you.
Make tr as server side Table Row
Like


<table style="WIDTH: 734px; HEIGHT: 273px" cellSpacing="0"
cellPadding="2" border="0">
<tr Runat="Server" visible="fasle" id="tr1">
<td style="WIDTH: 56px; HEIGHT: 23px"><asp:textbox
id="txtNumDaysYr1" Runat="server" Width="59px"
ToolTip="Enter Year 1" "></asp:textbox>
</td>
<td style="WIDTH: 38px; HEIGHT: 23px"><asp:checkbox
id="chkCage1" runat="server" Width="22px" text='<font
style="VERTICAL-ALIGN: super" face = "tahoma" size = "0.1"
Color = "#800000">1 said:
</asp:checkbox></td>
<asp:customvalidator id="cvNumDaysYr1" Runat="server"
Display="Dynamic" ControlToValidate="txtNumDaysYr1"
ErrorMessage="* Number of days cannot be zero for Year 1"
onservervalidate="servervalidate_numdaysyr1"></asp:customva
lidator><asp:comparevalidator id="cmvNumDaysYr1"
Runat="Server" Display="Dynamic"
ControlToValidate="txtNumDaysYr1" Type="Double"
ErrorMessage="* Number of days for year 1 must be a
number" operator="datatypecheck"></asp:comparevalidator>
</tr>
</table>

so that you can have full control of table row now this row can be
displayed or not it's up to your code.



if this works out let me know @ this EmailID
(e-mail address removed)

Regards,
Rajupeta Prasanna
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top