Another Multiple Control error

Discussion in 'ASP .Net' started by Mike Smith, Jul 27, 2004.

  1. Mike Smith

    Mike Smith Guest

    I am attempting to create a dynamic multi-level tab strip from a
    database using linkbuttons. I can get the controls added to the page on
    the first page load, but on post back I get the mutiple control error.
    I have read other postings, but none seem to give the right answer for
    my case.

    Do I need to cache the items on the first load so that I am not hitting
    the database again or is there a way to only load this information once?

    Thank you for your help.

    Mike

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Mike Smith, Jul 27, 2004
    #1
    1. Advertising

  2. "Mike Smith" <> wrote in message
    news:...
    >
    >
    > I am attempting to create a dynamic multi-level tab strip from a
    > database using linkbuttons. I can get the controls added to the page on
    > the first page load, but on post back I get the mutiple control error.
    > I have read other postings, but none seem to give the right answer for
    > my case.
    >
    > Do I need to cache the items on the first load so that I am not hitting
    > the database again or is there a way to only load this information once?


    Mike, you haven't really given enough information about this problem. For
    instance, what specific "multiple control error" are you receiving, and
    exactly where are you getting it (please provide the stack trace).

    I'm guessing that you may be receiving an error about multiple controls with
    the same ID. If that's the case, you're probably getting it when you're
    adding your LinkButtons. If so, you should ask why the link buttons are
    already present in their parent's Controls collection. As a brute force
    method, you could use Controls.Clear before adding any LinkButtons.

    If you're creating a composite control, take a look at the following
    pattern. If you follow this pattern and create the child controls (the link
    buttons) in the CreateChildControls method, then you shouldn't have a
    problem:

    Developing a Composite Control
    (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
    ml/cpcondevelopingcompositecontrols.asp)
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jul 27, 2004
    #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. nail
    Replies:
    0
    Views:
    1,529
  2. qwerty
    Replies:
    3
    Views:
    9,265
    Scott Allen
    Sep 30, 2004
  3. et
    Replies:
    1
    Views:
    510
    Yunus Emre ALPĂ–ZEN [MCSD.NET]
    Jun 29, 2005
  4. Matt Sokol
    Replies:
    2
    Views:
    367
    Theo Tillotson
    Aug 7, 2003
  5. et
    Replies:
    0
    Views:
    138
Loading...

Share This Page