create RangeValidator at Runtime [RESOLVED]
I am dynamically creating my form because the information I want in this form is controlled by a database and therefore needs to be dynamic. I am creating a RangeValidator:
Code:
QtyVal = New RangeValidator()
QtyVal.ID = CStr("ValQty" & DBReader("ProdSKU"))
QtyVal.Attributes.Add("Type","Integer")
QtyVal.ControlToValidate = CStr(NewTxtBx.ID)
QtyVal.MaximumValue = "30"
QtyVal.MinimumValue = "1"
QtyVal.Attributes.Add("runat","server")
QtyVal.Text = "<BR>Must be between 1 and 30"
QtyVal.Attributes.Add("display","static")
My problem is that it validates the values as a string (i.e. User enter 1-3 everything ok, 4 and up and validation dies). Any ideas?