Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamic Wizard with Dynamic Validation Controls

Thread Tools

Dynamic Wizard with Dynamic Validation Controls

Posts: 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.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing what wizard to display (or wizard steps) based on a dropDownList value Andy B ASP .Net 0 04-19-2008 11:36 AM
ASP.NET Wizard with Wizard Steps being User Controls ASP .Net 0 09-21-2006 06:36 PM
.NET 2.0, wizard control with dynamic controls Mark Baker ASP .Net Web Controls 0 12-12-2005 09:46 PM
WinXP Microsoft Photo Printing Wizard, and Scanner and Camera Wizard Orak Listalavostok Digital Photography 5 07-10-2004 07:15 PM