如何消除文本框之间的额外空间 [英] How to eliminate the Extra space between textboxes
本文介绍了如何消除文本框之间的额外空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
aspx页面包含几个textBoxes。对于文本框,有3个验证器,它显示此文本框与其下方的另一个文本框之间的额外间距。如果只有2个验证器,则额外的空间消失了。我试过ccs但没有效果。如何消除额外的空间?谢谢。
< tr >
< td style = text-align:left >
< asp:标签 ID = lblPasswordNew runat = server CssClass = lbl 字体-Bold = true
字体大小 = 小 文字 = 新密码: > ;
< / asp:Label >
< / td >
< td class = style1 >
< asp:TextBox ID = txtPasswordNew runat = server AutoPostBack = < span class =code-keyword> false
< span class =code-attribute> < span class =code-attribute> ClientID = txtPasswordNew 字体大小 = 小 MaxLength = 45
< span class =code-attribute> onKeyDown = keyPress(); onKeyPress = keyPress(); TabIndex = 3
TextMode = 密码 宽度 = 150px >
< / asp:TextBox >
< asp:标签 ID = txtPasswordNew_V runat = server CssClass = lbl_req 文本 = *
宽度 = 5px > < / asp:标签 >
< / td >
< / tr >
< tr >
< td colspan = 3
style = text-align:center; padding-removed12em; padding-removed.12em; < span class =code-keyword>>
< asp:RequiredFieldValidator ID = RequiredFieldValidator2 runat = server
ControlToValidate = txtPasswordNew CssClass = lbl_error 显示 = 动态
< span class =code-attribute> ErrorMessage = 密码不能为空。 >
< / asp:RequiredFieldValidator >
< asp:RegularExpressionValidator ID = RegularExpressionValidator2 runat = server
< span class =code-attribute> ControlToValidate = txtPasswordNew CssClass = lbl_error < span class =code-attribute> 显示 = 动态
ErrorMessage = 密码必须包含至少8个字符,至少1个大写字母,1个小写字母,1个数字和1个特殊字符(!,@,#,$)并区分大小写。
ValidationExpression = ^(?=。* [AZ])(?=。* [AZ])(?=。* \d)(?=。* [$ @ $!#])[A-ZA -z\d $ @ $!#] {8,45} >
< / asp:RegularExpressionValidator >
< asp:CompareValidator ID = CompareValidator2 runat = server
ControlToCompare = txtPasswordOld ControlToValidate = txtPasswordNew
< span class =code-attribute> CssClass = lbl_error
< span class =code-attribute> ErrorMessage = 新密码必须与旧密码不同。
运算符 = NotEqual 类型 = 字符串 >
< / asp:CompareVa lidator >
< / td >
< / tr >
// --------- css下面--------
.lbl_error {
font-family:helvetica,arial,sans-serif;
font-size:较小;
text-align:center;
颜色:红色;
}
解决方案
)并且区分大小写。
有效ationExpression = ^(?=。* [az])(?=。* [AZ]) (?=。* \d)(?=。*
@
!#])[A-ZA-z\d
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.
<tr>
<td style="text-align: left">
<asp:Label ID="lblPasswordNew" runat="server" CssClass="lbl" Font-Bold="true"
Font-Size="Small" Text="New Password:">
</asp:Label>
</td>
<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:TextBox>
<asp:Label ID="txtPasswordNew_V" runat="server" CssClass="lbl_req" Text="*"
Width="5px"></asp:Label>
</td>
</tr>
<tr>
<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:RequiredFieldValidator>
<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."
ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!#])[A-Za-z\d$@$!#]{8,45}">
</asp:RegularExpressionValidator>
<asp:CompareValidator ID="CompareValidator2" runat="server"
ControlToCompare="txtPasswordOld" ControlToValidate="txtPasswordNew"
CssClass="lbl_error"
ErrorMessage="New password must be different from the old one."
Operator="NotEqual" Type="String">
</asp:CompareValidator>
</td>
</tr>
// --------- css below --------
.lbl_error {
font-family: helvetica, arial, sans-serif;
font-size:smaller;
text-align:center;
color:Red;
}
解决方案
) and is case sensitive." ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*
@
!#])[A-Za-z\d
这篇关于如何消除文本框之间的额外空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文