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

BaseValidator Custom Validator validating on a Repeater

Hi All,

I have a repeater that required a check box on each item in the repeater to
be validated against eachother (to check if only one item's checkbox is
ticked.) To perform this validation I created a validation control that
inherits from BaseValidator and performs server and client side checks and is
performing the validation on the repeater control.

The above all works except I cant get the client validation to stop the page
from submitting - it does not call the validation function for the control.

I have added code such as:

AddAttributesToRender { ...

writer.AddAttribute("evaluationfunction", "CheckAllCheckBoxes" +
this.ClientID);

....
}

or

RegisterValidatorDeclaration {

...

string element = "document.getElementById(\"" + this.ClientID + "\")";
Page.RegisterArrayDeclaration("Page_Validators", element);
...

}

Neither seem to enable the client script to be run when the submit button is
pressed.

Please help
Aug 17 '06 #1
1 2437
UPDATE:

OK, I have added both the code below and can see the validation occuring
when I click submit on the form. The reason it's not validating now is that
val.enabled in the asp.net javascript validation always returns false (where
val is the validation control.) I have done Enabled=true in the aspx and also
tried addAttribute("enabled","true") - neither work - it always comes up with
val.enabled = false.

Any other ideas?

"criz" wrote:
Hi All,

I have a repeater that required a check box on each item in the repeater to
be validated against eachother (to check if only one item's checkbox is
ticked.) To perform this validation I created a validation control that
inherits from BaseValidator and performs server and client side checks and is
performing the validation on the repeater control.

The above all works except I cant get the client validation to stop the page
from submitting - it does not call the validation function for the control.

I have added code such as:

AddAttributesToRender { ...

writer.AddAttribute("evaluationfunction", "CheckAllCheckBoxes" +
this.ClientID);

...
}

or

RegisterValidatorDeclaration {

..

string element = "document.getElementById(\"" + this.ClientID + "\")";
Page.RegisterArrayDeclaration("Page_Validators", element);
..

}

Neither seem to enable the client script to be run when the submit button is
pressed.

Please help
Aug 17 '06 #2

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

Similar topics

9
by: Leona | last post by:
Hello all, does anyone know of a tool, preferably free, preferably on linux, which will take an xml file and validate it against your own custom W3C XML Schema file (.xsd) ?? All help...
2
by: Evgueni | last post by:
Hello, I am new to .NET, and a custom validator is giving me a lot of grief. I want to use a Custom Validation control and for some reasons it's not firing the validation procedure. I am using...
1
by: philipl | last post by:
hi, i have a datagrid which display custom controls when user clicks edit, changing data. I am using customvalidator to validate this control. I can get validation of user input to work no...
5
by: Richard Payne | last post by:
Hi This is probably a newbie question but I can't seem to find a clear answer to the problem I have. I have created a Custom Validator control on my webform that works fine, but when I put...
2
by: Jerrad | last post by:
I have a textbox and a button within a repeater. The OnItemCommand sub of the repeater looks like this: Sub RepeaterButtonSub(ByVal source As Object, ByVal e As RepeaterCommandEventArgs) Dim...
3
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired,...
0
by: Sri Prasad Tadimalla | last post by:
I have a group of Validators inheriting from BaseValidator on my page. The Display property is set to None for all of them. I use the validator to change the label of the control I'm validating to...
1
by: Rory Becker | last post by:
Hi All It's been a while since I tried anything like this and it's just driving me nuts.. I want to have simple templated repeater which contains (Per item) a Label, a textbox and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.