asp.net验证间距与文本框上的2个验证控件混淆

时间:2022-05-18 03:18:14

asp.net validation spacing is messed up with 2 validation controls on a textbox.

asp.net验证间距与文本框上的2个验证控件混淆。

I tried playing with display static/dynamic but that didn't work.

我尝试使用显示静态/动态,但这不起作用。

ideas?

Update What is happening is this, if the 2nd validation control displays its message, the 1st validation is using up some white space as a placeholder for its message. So there is a huge gap between the control and the error message. If the 1st validations controls message is displayed, it looks just fine.

更新正在发生的事情是,如果第二个验证控件显示其消息,则第一个验证将使用一些空格作为其消息的占位符。因此控件和错误消息之间存在巨大差距。如果显示第一个验证控件消息,它看起来很好。

1 个解决方案

#1


Display should be set to dynamic for both of these controls. From the sounds of it the first validation control has this property set to static.

对于这两个控件,应将显示设置为动态。从它的声音来看,第一个验证控件将此属性设置为静态。

#1


Display should be set to dynamic for both of these controls. From the sounds of it the first validation control has this property set to static.

对于这两个控件,应将显示设置为动态。从它的声音来看,第一个验证控件将此属性设置为静态。