customvalidator to return 2 different error messages

E

Eric Layman

Hi,

Are there ways for customvalidator to have 2 different error messages?

eg: i have 2 conditions to check using customvalidator

depends on condition, i would need to return 2 different error msg

but the CustomValidator ErrorMessage attribute only allows one error msg.

Am I mistaken or are there better solutions? Eg: 2 different
customvalidators?

Please advise.

Thanks
 
E

Eric Layman

Hi everyone,

I've got the solution:

DirectCast(s, CustomValidator).ErrorMessage = "My err mesg"
 
S

sloan

Pay attention to the javascript alert version of the message VS the textarea
output.

what I mean is that if you have the message show up in a javascript alert
box
and/or have the message show up on the browser page in the "summary",

pay attention to the formatting.

esp

<br> and \n\r



Eric Layman said:
Hi everyone,

I've got the solution:

DirectCast(s, CustomValidator).ErrorMessage = "My err mesg"
 
G

Guest

Howdy,

Use 2 custom validators or set the message in ServerValidate event handler
(server side) and in the validation function you call on the client side
ClientValidationFunction (if there is one).

hope this helps
 

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

Top