By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,905 Members | 1,585 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,905 IT Pros & Developers. It's quick & easy.

Dynamic Wizard with Dynamic Validation Controls

P: n/a
All, I have searched all around and have not yet found the answer to this nor
a solution. Hopfully it will be easy to overcome.

Here is what I am trying to do:

I'm trying to build a wizard form completely dynamic. I'm adding the
labels, textboxes, drop downs, radio buttons, etc dynamically. I am able to
add them via Page Init. Which seems to re-add every time a button or post
back is initiated. Don't know if this is the problem.

Continuing, some of the data entry or selection controls need validation. I
add a CompareFieldValidator and point all the attributes to a certain drop
down to make sure the value is Not Equal to 'Select'. I have tested this
exact validator and control in static form and this works. I've tried to
play with the other elements in the validation control configuration
properties to see if the outcome changes and nothing.

Here is the code that generates the control:

CompareFieldValidatorControl = New System.Web.UI.WebControls.CompareValidator
CompareFieldValidatorControl.ID = "rv" & ControlID
CompareFieldValidatorControl.CssClass = "formError"
CompareFieldValidatorControl.ControlToValidate = ControlID
CompareFieldValidatorControl.Operator =
CompareFieldValidatorControl.ValueToCompare =
CompareFieldValidatorControl.ErrorMessage =
CompareFieldValidatorControl.Enabled = True
CompareFieldValidatorControl.EnableClientScript = True
CompareFieldValidatorControl.Display = ValidatorDisplay.Dynamic
CompareFieldValidatorControl.ToolTip = "Correct the error before
...Control is added to page...

I see the code that is supposed to handle the validation but the validation
does not fail. When I click the 'Next' button the next page is built as it
should, but with no validation failure. That is the problem.

I tried to go another route and I cannot yet seem to figure out how to do

I tried to construct code to read each of the controls in the dynamic Wizard
for a certain step and I cannot figure out how to do that. What I would like
to do is be able to read a Typeof control of TextBox, DropDownList, and
RadioButton List. What is the syntax or code to loop through the Wizard
step's controls for a specific step?

Any help would be greatly appreciated. Thanks!

Steve Funk
Application Developer
iHomeowners, Inc.
Oct 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.