开发者

ASP.Net validator styling

I have multiple validators on a textbox (see structure below). When the RequiredFieldValidator passes but the CustomValidator fails there is a gap between the Textbox and the CustomValidator as the RequiredsFieldValidator has a Hidden CSS property.

[FieldLabel] [TextBox] [RequiredFieldValidator] [CustomValidator]

The HTML output from the validators can be seen below.

<input name="...Age" value="65" id="...Age" type="text">
<span id="...RequiredFieldValidator" style="color: rgb(195, 1, 185); visibility: hidden;">required</span>
<span id="...CustomValidator" style="color: rgb(195, 1, 185); visibility: visible;">must be between 55 and 74</span>

How can I make sure there is no space between the textbox and CustomValid开发者_开发技巧ator?


set Display="Dynamic" property of Validator

MSDN: ASP.NET Validation in Depth

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜