By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Problem with white space on page

P: n/a
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>
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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</font>' ToolTip="Cage1"
</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
pr******@pacsoft.co.in

Regards,
Rajupeta Prasanna

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.