Problem with databinding in a composite control

Discussion in 'ASP .Net' started by Charlie@CBFC, Oct 8, 2005.

  1. Charlie@CBFC

    Charlie@CBFC Guest

    Hi:

    I'm creating some composite custom server controls that combine user
    interface element and a validation control. One such control combines a
    dropdownlist and required field validator. The problem is when I want to
    use it on a form, how do I get a reference to the dropdownlist contained
    within the control to call databind method? Also, if I call databind within
    server control, it works but viewstate doesn't work. Does any know of any
    example of how to do this?

    Thanks,
    Charlie
    Charlie@CBFC, Oct 8, 2005
    #1
    1. Advertising

  2. Charlie@CBFC

    Teemu Keiski Guest

    Hi,

    you would need to expose the DDL out as a property (or then expose certain
    strategic properties like DataSource out from the control, and override
    DataBind method, and call straight that of your composite control when
    databinding
    )


    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "Charlie@CBFC" <> wrote in message
    news:eyLqr$...
    > Hi:
    >
    > I'm creating some composite custom server controls that combine user
    > interface element and a validation control. One such control combines a
    > dropdownlist and required field validator. The problem is when I want to
    > use it on a form, how do I get a reference to the dropdownlist contained
    > within the control to call databind method? Also, if I call databind
    > within
    > server control, it works but viewstate doesn't work. Does any know of any
    > example of how to do this?
    >
    > Thanks,
    > Charlie
    >
    >
    Teemu Keiski, Oct 9, 2005
    #2
    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,684
    sleigh
    Feb 12, 2004
  2. =?Utf-8?B?U3RldmU=?=

    Databinding on Composite Control

    =?Utf-8?B?U3RldmU=?=, Dec 15, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    565
    =?Utf-8?B?U3RldmU=?=
    Dec 15, 2005
  3. Chad
    Replies:
    0
    Views:
    219
  4. Steve

    Databinding on Composite Control

    Steve, Dec 15, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    171
    Teemu Keiski
    Dec 18, 2005
  5. Steve

    Databinding on Composite Control

    Steve, Dec 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    109
    Steve
    Dec 15, 2005
Loading...

Share This Page