如何在Maskededitvalidator中使用Dsiplay图像错误而不是Invalidvaluemessage [英] How Do I Dsiplay An Image Error In Maskededitvalidator Instead Of Invalidvaluemessage

查看:88
本文介绍了如何在Maskededitvalidator中使用Dsiplay图像错误而不是Invalidvaluemessage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在asp.net中为datepicker创建一个用户控件。我使用AjaxControlToolkit创建UC,

这里我使用了CalendarExtender,MaskedEditExtender和MaskedEditValidator



我怎么做dsiplay图像错误MaskedEditValidator而不是InvalidValueMessage



在RequiredFieldValidator中我们可以显示图像错误消息我可以向MaskedEditValidator添加图像错误消息并且不显示InvalidValueMessage



欢迎任何帮助或建议



i am creating an user control for datepicker in asp.net. i have used AjaxControlToolkit for create the UC,
here i have used CalendarExtender,MaskedEditExtender and MaskedEditValidator

how do i dsiplay an image error in MaskedEditValidator instead of InvalidValueMessage

like in RequiredFieldValidator we can show an image error message same way can i add an image error message to MaskedEditValidator and not showing the "InvalidValueMessage"

any help or suggestion is most welcome

推荐答案

将验证器包装在具有属性display:none的div中。



创建一个定义背景的CSS样式。定位它以适合图像。



将div的css设置为上面背景图片的样式标签。



检测到出错时,然后删除display属性以使其可见。这将在RFV激活时显示图像。
Wrap the validator inside a div which has attributes display:none.

Create a css style which defines a background. position it to fit the image.

Set the css of the div to the style tag of the background image above.

Detect when there is an error, then remove the display attribute so that it becomes visible. This will show the image when RFV is active.


这篇关于如何在Maskededitvalidator中使用Dsiplay图像错误而不是Invalidvaluemessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆