473,405 Members | 2,338 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,405 software developers and data experts.

Custom Validation Summary Problem

kpg
I can't get the CustomValidator (CV) ErrorMessage to display
in the ValidationSummary.

On the same page I have several RequiredField Validators
and a Range Validator, that all work just fine, that is,
the ErrorMessage text is displayed by the Validation summary
control.

If I leave the CV Text field blank then the errormmessage
does display on the CV itself.

According to the MSDN help, the Validation summary control
should display the messages of all validator controls
on the page.

Is this a bug or am I doing something wrong?

kpg
Dec 15 '06 #1
4 6860
the validation summary only updates its display when a submit is attempted.

-- bruce (sqlwork.com)

kpg wrote:
I can't get the CustomValidator (CV) ErrorMessage to display
in the ValidationSummary.

On the same page I have several RequiredField Validators
and a Range Validator, that all work just fine, that is,
the ErrorMessage text is displayed by the Validation summary
control.

If I leave the CV Text field blank then the errormmessage
does display on the CV itself.

According to the MSDN help, the Validation summary control
should display the messages of all validator controls
on the page.

Is this a bug or am I doing something wrong?

kpg
Dec 15 '06 #2
kpg
bruce barker <no****@nospam.comwrote in
news:ew**************@TK2MSFTNGP06.phx.gbl:
the validation summary only updates its display when a submit is
attempted.
I have a submit button with validation set to true, when
clicked, the other vaidation control's error messages are
displayed in the validation control. Everything is set up
properly, but the custom validator's errormessage does not
display in the validation summary message box.

kpg
Dec 15 '06 #3
There are several things you need to ensure to have a customValidator
work.

1) The customValidator has to appear in the same container as the field
being validated

2) Even if you aren't using client-side validation, you still have to
specify an empty error checking function in the JScript of the HTML
page on which the validator resides. And, this "dummy" function has to
return true for its args (make sure you specify the name of this
function in the property list for the validator)

function customvalidator(source,args){
args.IsValid=true;
}

3) In the server-side custom validation code, you have to set three
properties on your validator if the check failed for the message to
appear in the summary control, and your server-side custom validation
code has to return false for edit failures:
private function yourCustomCheckingRoutine()
System.Boolean blnResult=true;

if(yourTest)
{
blnResult=false;
cvYourValidator.ErrorMessage="Your error message";
cvYourValidator.Text="*";
cvYourValidator.IsValid=false;
}

return(blnResult);
}

Dec 15 '06 #4
kpg
"Andy" <an****@infotek-consulting.comwrote in
news:11**********************@l12g2000cwl.googlegr oups.com:
2) Even if you aren't using client-side validation, you still have to
specify an empty error checking function in the JScript of the HTML
page on which the validator resides. And, this "dummy" function has to
return true for its args (make sure you specify the name of this
function in the property list for the validator)

This was it. Once I added the dummy function it worked.

This must be a bug, the documentation says the client side script
is optional.

Thanks
kpg
Dec 15 '06 #5

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

Similar topics

0
by: Libs | last post by:
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so that it would display the error msgs of all my...
3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
2
by: Lucas Tam | last post by:
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...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
4
by: Mike Moore | last post by:
For some reason our validation summary message box works with required validators that we have, but for some reason when we created a custom validator that checks for duplciate records the show...
0
by: Cleako | last post by:
Here is my dilema. I have a validation summary that I use soley for my Required Field Validators. I have it setup to run from a Page.Validate call in the code-behind, this is because I need to...
2
by: nmakhan | last post by:
I have a validation summary that I use soley for my Required Field Validators. That works fine if I do things that way up to a point, if by chance the validation summary says "Date field...
1
by: DotNetNewbie | last post by:
Hello, I have a validation summary tag in my .aspx page, and when a user clicks on a submit button I check the database for a duplicate username that the user entered into a textbox control. If...
1
by: daveh551 | last post by:
I have a web page with an address entry form and some other things on it. The form has field validators on several of the fields, and a validation summary at the bottom. Because of the size of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.