customvalidator to return 2 different error messages

  • Thread starter Thread starter Eric Layman
  • Start date Start date
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
 
Hi everyone,

I've got the solution:

DirectCast(s, CustomValidator).ErrorMessage = "My err mesg"
 
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"
 
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
 
Back
Top