471,119 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

Dynamic Wizard with Dynamic Validation Controls

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
0 1421

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Nathan Bloomfield | last post: by
1 post views Thread by Mike George | last post: by
6 posts views Thread by dhnriverside | last post: by
3 posts views Thread by rgparkins | last post: by
1 post views Thread by Elliot Rodriguez | last post: by
reply views Thread by Eniac | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.