Problem with white space on page

Discussion in 'ASP .Net' started by Amar, Jan 15, 2004.

  1. Amar

    Amar Guest

    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>
     
    Amar, Jan 15, 2004
    #1
    1. Advertising

  2. 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


    Regards,
    Rajupeta Prasanna

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Prasanna Rajupeta, Jan 16, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shuo Xiang

    Stack space, global space, heap space

    Shuo Xiang, Jul 9, 2003, in forum: C Programming
    Replies:
    10
    Views:
    2,944
    Bryan Bullard
    Jul 11, 2003
  2. Christian Seberino
    Replies:
    21
    Views:
    1,726
    Stephen Horne
    Oct 27, 2003
  3. Ian Bicking
    Replies:
    2
    Views:
    1,059
    Steve Lamb
    Oct 23, 2003
  4. Ian Bicking
    Replies:
    2
    Views:
    754
    Michael Hudson
    Oct 24, 2003
  5. Ben C
    Replies:
    6
    Views:
    2,193
    Leif K-Brooks
    Jan 28, 2007
Loading...

Share This Page