Displaying a Validation Error in a Validation Summary Control

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.
 
T

Teemu Keiski

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.
 
L

Lucas Tam

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top