CompareValidator not working where a RangeValidator is

H

hooterbite

The range validator works, the compare validator doesn't.

Dim txbNew As New TextBox
txbNew.ID = "txb" & arStyles(i)

Dim rvNew As New RangeValidator
rvNew.Text = "Must be a number greater then 0"
rvNew.ControlToValidate = "txb" & arStyles(i)
rvNew.EnableClientScript = False
rvNew.MinimumValue = 1
rvNew.MaximumValue = 1000

Dim cvNew As New CompareValidator
cvNew.Text = "Must be a number greater then 0"
cvNew.ControlToValidate = "txb" & arStyles(i)
cvNew.EnableClientScript = False
cvNew.Operator = ValidationCompareOperator.DataTypeCheck
cvNew.Type = ValidationDataType.Integer

tdBox.Controls.Add(txbNew)
tdBox.Controls.Add(cvNew)
tdBox.Controls.Add(rvNew)
 
H

hooterbite

Thanks Brock, if you looked at the code you would see that it is there
- cvNew.Type = ValidationDataType.Integer
 
B

Brock Allen

But rvNew does not. Type in 01 into the range validator and see if it still
works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top