Dynamic Wizard with Dynamic Validation Controls

Discussion in 'ASP .Net' started by =?Utf-8?B?U3RldmUgRnVuaw==?=, Oct 13, 2006.

  1. 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 =
    ErrorHandling.ErrorMessageOperator
    CompareFieldValidatorControl.ValueToCompare =
    ErrorHandling.ErrorValuetoCompare
    CompareFieldValidatorControl.ErrorMessage =
    ErrorHandling.ErrorMessage
    CompareFieldValidatorControl.Enabled = True
    CompareFieldValidatorControl.EnableClientScript = True
    CompareFieldValidatorControl.Display = ValidatorDisplay.Dynamic
    CompareFieldValidatorControl.ToolTip = "Correct the error before
    proceeding"
    ...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
    this:

    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.
     
    =?Utf-8?B?U3RldmUgRnVuaw==?=, Oct 13, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sviau
    Replies:
    1
    Views:
    383
    Steven Cheng[MSFT]
    Mar 3, 2004
  2. =?Utf-8?B?VmVhcg==?=

    Validation process to cancel New user Wizard step?

    =?Utf-8?B?VmVhcg==?=, Apr 23, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,116
    =?Utf-8?B?VmVhcg==?=
    Apr 23, 2006
  3. Replies:
    0
    Views:
    612
  4. Andy B
    Replies:
    0
    Views:
    446
    Andy B
    Apr 19, 2008
  5. Mark Baker

    .NET 2.0, wizard control with dynamic controls

    Mark Baker, Dec 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    170
    Mark Baker
    Dec 12, 2005
Loading...

Share This Page