似乎我使用TextMode="password"
它会改变文本框的大小以及占位符文本样式。它与我制作的其他文本框不匹配。虽然它对我有用,但只是好奇是否还有另一种方法可以避免破坏设计。谢谢!
<div class="form-group" style= "float:left">
<asp:TextBox ID="txtPW" runat="server" name="form-password-name" Width="200px"
placeholder="Password..." class="form-password form-control"
TextMode="Password"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server"
ErrorMessage="Only letters and numbers are allowed" Display="Dynamic" ControlToValidate="txtPW"
ForeColor="Red" ValidationExpression="^[a-zA-Z0-9]+$">
</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ErrorMessage="Password is required." ControlToValidate="txtPW" Display="Dynamic" ForeColor="Red">
</asp:RequiredFieldValidator>
</div>
答案 0 :(得分:0)
您可以使用常规的html文本框:
<input type="password" name="form-password-name" id="txtPW" class="form-password form-control"/>