Displaying a Validation Error in a Validation Summary Control

  • Thread starter Thread starter Lucas Tam
  • Start date Start date
L

Lucas Tam

Hi all,


I want to display an error message from a custom validator in my Validation
Summary control.

Do I need to build the ServerValidate Event handler in order to display an
error message?

All I wish to do is raise an error message on a failed database insert -
can I just set cvMyCustomValidator.IsValid = False?

Thanks.
 
If validation summary is in MessageBox mode, it won't show the message
unless your custom validator works at client as well. At server side it is
the setting of IsValid=false as you noted but it works only if validation
summary has ShowSummary=True specified. Yes, it is specified in
ServerValidate event handler.
 
At server side it is
the setting of IsValid=false as you noted but it works only if validation
summary has ShowSummary=True specified. Yes, it is specified in
ServerValidate event handler.

I can only seem to get my "dummy" validator to work if I have an event
hanlder in place.

Setting Isvalid=False alone doesn't seem to work...

Is there a way I can insert an error message into the ValidationSummary
without all the event handler code? (not much, but tedious). Thanks!
 
Back
Top