Dynamic Form Validation

jeffpeters

Member
Joined
Jul 28, 2006
Messages
14
Programming Experience
5-10
Hi

I am building a dynamic survey questionnaire builder where the Q&A etc is stored in a database.

Along with the Q&A I am also storing what validation is necessary for each form object in the database. For example a drop down list may be deemed mandatory so this will require a compareValidator to ensure the user has not left the value at "Select" etc.

Trouble is while this is easy to create in the designer, I cant get it to work in code. Am I missing something???

Thanks in advance

Jeff

Dim valCompare As New CompareValidator
valCompare.ControlToValidate =
CStr(Questionid)
valCompare.Operator = ValidationCompareOperator.NotEqual
valCompare.ValueToCompare =
"Select"
valCompare.ErrorMessage = "*"
valCompare.ForeColor = Drawing.Color.Red
PlaceHolder1.Controls.Add(valCompare)
 
Back
Top