Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

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
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900