473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

customvalidator to return 2 different error messages

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

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 27 '07 #1
3 2235
Hi everyone,

I've got the solution:

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


"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
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
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 27 '07 #2

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

<brand \n\r

"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
Hi everyone,

I've got the solution:

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


"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
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
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Mar 27 '07 #3
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
--
Milosz
"Eric Layman" wrote:
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

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Mr. x | last post by:
Hello, I have some code as follows. It seems that customValidator doesn't work - because i don't get any message. In the body : <asp:table> <asp:TableRow>
5
by: Gene McCrory | last post by:
Is it possible to have a CustomValidator against two controls in an EditItemTemplate on a DataGrid? Case: Have a business rule that states if ATextBox starts with "ACertainValue" then BTextBox...
2
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a...
3
by: philipl | last post by:
hi, i have a textbox in my edititemtemplate in my datagrid. I have created a customvalidator for it, when i update the row the appropiate function gets called to customvalidate but the problem...
1
by: SMG | last post by:
Hi All. My forms has two textboxes, 1 username, 2 password. Both has requiredfield validator it works fine when there is no input in these textboxes. And the errorMsg is shown in...
1
by: Dan Sikorsky | last post by:
I'm getting the following message when I try to add a CustomValidator control to the ValidationSummary to display an error message at runtime, and displaying ex.message in AddValidationControl...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
6
by: Dabbler | last post by:
I'm trying to use a custom validator but it seems to trigger no matter what I do. I'm not sure i'm referencing the controls involved correctly from the js. My FormView is named fvRegDetail. I've...
2
by: Epetruk | last post by:
Hello, I have an ASP.NET page which consists of a button (cmdSave), a label (lblMessage), a text field (txtName) and a custom validator (vldName). vldName is supposed to do both client *and*...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.