Validation inside composite controls for ASP .NET 2.0

Discussion in 'ASP .Net Web Controls' started by JorgeDorcasGarcia@hotmail.com, Apr 10, 2006.

  1. Guest

    I'm creating a group of composite controls. Some are more granular than
    others, for example, a Zip Code control. The control has a TextBox for
    Zip Code, a TextBox for Zip Extension and compare validators for both
    of these controls in order to make sure the user enters numeric
    information.
    If I put this composite control in my page by itself, the client side
    validation works perfectly fine, but as soon as I wish to use this
    control inside another composite control, like say, an "Address"
    control, the client side validation starts to generate javascript
    errors at load time, apparently not able to find the controls on the
    page, when the page loads in the browser. I am stating inside the Zip
    Code composite control that the cvZipCode.ControlToValidate =
    txtZipCode.ID. Note, I'm NOT getting a server side error, the error is
    on the client side scripting. Is this a bug in the framework? Does this
    mean I won't be able to use validation if I go 2 levels deep in my
    composite controls? I even tried with one of the MSPress controls
    (datepicker) from the book "ASP.NET SERVER CONTROLS AND COMPONENTS" and
    it also gives me errors with it.

    Any help would be appreciated greatly.

    Thanks.

    Jorge L. Garcia
    Miami, FL
     
    , Apr 10, 2006
    #1
    1. Advertising

  2. Brock Allen Guest

    Does your composite control derice from CompositeControl or does it implement
    INamingContaner?

    -Brock
    http://staff.develop.com/ballen


    > I'm creating a group of composite controls. Some are more granular
    > than
    > others, for example, a Zip Code control. The control has a TextBox for
    > Zip Code, a TextBox for Zip Extension and compare validators for both
    > of these controls in order to make sure the user enters numeric
    > information.
    > If I put this composite control in my page by itself, the client side
    > validation works perfectly fine, but as soon as I wish to use this
    > control inside another composite control, like say, an "Address"
    > control, the client side validation starts to generate javascript
    > errors at load time, apparently not able to find the controls on the
    > page, when the page loads in the browser. I am stating inside the Zip
    > Code composite control that the cvZipCode.ControlToValidate =
    > txtZipCode.ID. Note, I'm NOT getting a server side error, the error is
    > on the client side scripting. Is this a bug in the framework? Does
    > this
    > mean I won't be able to use validation if I go 2 levels deep in my
    > composite controls? I even tried with one of the MSPress controls
    > (datepicker) from the book "ASP.NET SERVER CONTROLS AND COMPONENTS"
    > and
    > it also gives me errors with it.
    > Any help would be appreciated greatly.
    >
    > Thanks.
    >
    > Jorge L. Garcia
    > Miami, F
     
    Brock Allen, Apr 10, 2006
    #2
    1. Advertising

  3. JGarcia Guest

    It derives from CompositeControl, which as far as I know, it implements
    the INamingContainer interface.
     
    JGarcia, Apr 10, 2006
    #3
  4. Brock Allen Guest

    Yeah, CompositeControl implements it. I was hoping this would be the problem
    and thus the quick fix for you. I'll have to go think about it some more
    then :)

    -Brock
    http://staff.develop.com/ballen


    > It derives from CompositeControl, which as far as I know, it
    > implements the INamingContainer interface.
    >
     
    Brock Allen, Apr 10, 2006
    #4
    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. sleigh
    Replies:
    1
    Views:
    2,740
    sleigh
    Feb 12, 2004
  2. dx
    Replies:
    10
    Views:
    966
    John Saunders
    Apr 11, 2004
  3. Webmills
    Replies:
    0
    Views:
    393
    Webmills
    Apr 21, 2006
  4. Joel Barsotti

    Client Side Validation and Composite Custom Controls

    Joel Barsotti, Jan 15, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    132
    Joel Barsotti
    Jan 15, 2004
  5. Mike

    Composite vs non composite Controls

    Mike, Mar 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    293
    Sundararajan
    Mar 11, 2005
Loading...

Share This Page