Click here to Skip to main content
14,971,296 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
An aspx page contains a couple of textBoxes. For a textbox, there are 3 Validators, which shows an extra spacing between this textbox and another one below it. If there are only 2 validators, the extra space is gone. I tried the ccs but not effective. How can the extra space be eliminated? Thanks.

            <td style="text-align: left">
                <asp:Label ID="lblPasswordNew" runat="server" CssClass="lbl" Font-Bold="true" 
                    Font-Size="Small" Text="New Password:">
            <td class="style1">
                <asp:TextBox ID="txtPasswordNew" runat="server" AutoPostBack="false" 
                    ClientID="txtPasswordNew" Font-Size="Small" MaxLength="45" 
                    onKeyDown="keyPress();" onKeyPress="keyPress();" TabIndex="3" 
                    TextMode="Password" Width="150px">
                <asp:Label ID="txtPasswordNew_V" runat="server" CssClass="lbl_req" Text="*" 
            <td colspan="3" 
                style="text-align: center;padding-removed.12em;padding-removed.12em;">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtPasswordNew" CssClass="lbl_error" Display="Dynamic" 
                    ErrorMessage="Password cannot be empty.">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtPasswordNew" CssClass="lbl_error" Display="Dynamic" 
                    ErrorMessage="Password must contain minimum 8 characters at least 1 upper case alphabet, 1 lower case alphabet, 1 number and 1 special character (!,@,#,$) and is case sensitive." 
            <asp:CompareValidator ID="CompareValidator2" runat="server" 
                    ControlToCompare="txtPasswordOld" ControlToValidate="txtPasswordNew" 
                    ErrorMessage="New password must be different from the old one." 
                    Operator="NotEqual" Type="String">
// --------- css below --------
        .lbl_error  {
            font-family: helvetica, arial, sans-serif;

1 solution

It involves two CSS things: padding and margins. Please see:[^],[^].

s yu 22-Apr-15 13:29pm
SA: Thanks for your response. I checked and played my css items: padding and margins, but not working.
Sergey Alexandrovich Kryukov 22-Apr-15 15:27pm
It does work. You could have missed some properties on some elements.
I was not a "response", it was the answer to your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900