Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Chris Kennedy #1
Dynamic Validation Control
I am adding several controls dynamically in a composite control. Everytime I
add a control to the controls collection I increment an integer so I would
guess I know the where about the control is in the control collection.
I get the id of that control like this
validateid = Controls(ControlCounter).id
valrequired.ControltoValidate = validateid
Next I add a validate control. This causes my control to throw an error
The ControlToValidate property of '' cannot be blank.
I have also tried to uniqueid but I then get:
Unable to find control id 'CompControl1:_ctl2' referenced by the
'ControlToValidate' property of
Can anyone point me in the right direction, Chris.
Chris Kennedy Guest
-
Dynamic validation with JS, RegEx, and CF
I need to build a reusable complex form validator and was thinking of storing the validation logic (RegEx expressions) in the database for each... -
Dynamic Validation of Required Fields
I am currently using a standard HTML form in which a user must enter certain data (required). The form has 2 submit buttons, 1 of which changes the... -
dynamic form validation
I have a form with some dynamic elements in it. The code is below It is a self assessment and the user must make some selections. The first part... -
Syntax for dynamic validation control
I want to assign a validation control dynamically. How do I tell it what control to validate via the controls collection. It seems to want a string... -
only custom validation control does server side validation?
On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator... -
Unregistered #2
Re: Dynamic Validation Control
When you create the target control, set the id to some value, then you use the same value to set the ControltoValidate of the validator.
e.g.
TextBox txtBox = new TextBox();
txtBox.ID = "txt_box_target";
RequiredFieldValidator rfv = new RequiredFieldValidator();
rfv.ControlToValidate = txtBox.ID;Unregistered Guest



Reply With Quote


