473,796 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Validation Summary Problem

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

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 6881
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 ValidationSumma ry.

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******** ******@TK2MSFTN GP06.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=tr ue;
}

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 yourCustomCheck ingRoutine()
System.Boolean blnResult=true;

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

return(blnResul t);
}

Dec 15 '06 #4
kpg
"Andy" <an****@infot ek-consulting.comw rote in
news:11******** **************@ l12g2000cwl.goo glegroups.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
1941
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 validation controls. As I tab out of txtField (that contains an invalid input) the validation summary doesnt show up, until the page is posted back. Any ideas why this happens?
3
2341
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 items missing etc.all working fine... However, when the user logs in I fire off to a stored procedure, at this point, unless the login is successful I can return up to about 8 different error numbers in a string which I then split out into an...
2
2797
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 message? All I wish to do is raise an error message on a failed database insert -
2
3738
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 all the messages to a message box (ShowMessageBox=true). The required field validation error messages show up in the summary just fine but I can't get the custom validation message to show up if invalid. So far I have the summary control...
4
7443
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 message box doesn't work. Any ideas?
0
2874
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 be able to clear text or other various functions need to be checked before it hits the back side. That works fine if I do things that way up to a point, if by chance the validation summary says "Date field required" then I edit the date and...
2
5253
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 required" then I edit the date and input an incorrect date, which I have a JavaScript validation for, that message will come up saying how to enter the date. The problem is that the validation summary is now populated and it wont
1
2575
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 I find a duplicate username in the database, I want to insert a message into the validationsummary control like "username already exists, please enter a different username". How can I do this?
1
2587
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 the form, on a typical screen, you need to scroll to see the bottom of the form, which is where the validation summary is. So when a user presses submit, and gets a validation error, the screen redisplays, but it redisplays from the top with...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7552
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.