Dynamic validator Query

Discussion in 'ASP .Net' started by Nergal, Jan 24, 2005.

  1. Nergal

    Nergal Guest

    Is it possible to add a validator at runtime and have it validate ?

    I add a bunch of textboxes, validators etc dynamically and restore them on
    postback but whatever I do the validator controls always return false for
    IsValid.

    TIA.


    --
    ¬¬¬¬nergal¬¬¬¬
     
    Nergal, Jan 24, 2005
    #1
    1. Advertising

  2. Nergal

    Hans Kesting Guest

    Nergal wrote:
    > Is it possible to add a validator at runtime and have it validate ?
    >
    > I add a bunch of textboxes, validators etc dynamically and restore them on
    > postback but whatever I do the validator controls always return false for
    > IsValid.
    >
    > TIA.
    >
    >


    Yes it is possible. I generate some pages including validators
    and they work fine. When are you adding those controls? It should
    be in Page_Load (or maybe Page_Init).

    --
    Hans Kesting
     
    Hans Kesting, Jan 24, 2005
    #2
    1. Advertising

  3. Nergal

    Nergal Guest

    Hans Kesting <> wrote in
    news:#:

    > Nergal wrote:
    >> Is it possible to add a validator at runtime and have it validate ?
    >>
    >> I add a bunch of textboxes, validators etc dynamically and restore
    >> them on postback but whatever I do the validator controls always
    >> return false for IsValid.
    >>
    >> TIA.
    >>
    >>

    >
    > Yes it is possible. I generate some pages including validators
    > and they work fine. When are you adding those controls? It should
    > be in Page_Load (or maybe Page_Init).
    >


    Thanks for your reply.

    I found the problem, the parent control was Visible = false; therefore the
    validators always return true.

    Thanks to reflector for uncovering that one ;)

    Cheers


    --
    ¬¬¬¬nergal¬¬¬¬
     
    Nergal, Jan 24, 2005
    #3
    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. coollzh
    Replies:
    0
    Views:
    381
    coollzh
    Jun 3, 2004
  2. =?Utf-8?B?U3RldmUgV29uZGVyZnVs?=

    ASP.NET 1.1 Bug - Dynamic RE Validator

    =?Utf-8?B?U3RldmUgV29uZGVyZnVs?=, Mar 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    =?Utf-8?B?U3RldmUgV29uZGVyZnVs?=
    Mar 1, 2006
  3. Anonymous
    Replies:
    0
    Views:
    1,475
    Anonymous
    Oct 13, 2005
  4. dynamic validator images

    , Jul 14, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    470
    delta
    Jul 15, 2006
  5. Replies:
    4
    Views:
    904
    Richter~9.6
    Feb 13, 2007
Loading...

Share This Page