Controls inside UpdatePanel being duplicated on second click

Last post 03-05-2008 8:27 AM by Jonathan Shen – MSFT. 1 replies.

Sort Posts:

  • Controls inside UpdatePanel being duplicated on second click

    02-29-2008, 3:04 PM
    • Member
      25 point Member
    • njsokalski
    • Member since 02-11-2007, 3:43 AM
    • Pennsylvania
    • Posts 50

    I am writing an application that displays a list of LinkButtons (created by a Repeater), one of which the user can click to fill in a TextBox. The list appears when the user click the Button for the desired TextBox, and then disappears when they click one of the LinkButtons. So far so good. However, the TextBox does not get filled in. If the user clicks one of the Buttons for one of the TextBoxes a second time, all the controls inside the UpdatePanel are duplicated using the EXACT same ClientId (I am not sure why they are placed where they do on the page), and the duplicate TextBox does have the text in it that the original was supposed to have. After this, the controls do not get duplicated anymore, and regardless of whether the original or duplicate Button is used, the Text is displayed in the duplicate TextBox (obviously because they have the same ClientId).

    The process I use to assign the text to the TextBox is the following:

    1. Assign the id for the text to a HiddenField associated with the the TextBox (since the part I care about is the id, not the text, but the user needs to see the text)
    2. Use the id to get the text from a database
    3. Assign that text to the TextBox
    4. Hide the list of LinkButtons

    A few things I want to point out are that none of the controls in the UpdatePanel are dynamically created. The trigger for the UpdatePanel is the ItemCommand event of the Repeater. I also have ChildrenAsTriggers="False" and UpdateMode="Conditional".

    Why are the controls in my UpdatePane being duplicated? Also, why is the text not being display when I click the LinkButton (since that is a Trigger for the UpdatePanel)? Any help would be appreciated. Thanks.

    --
    Nathan Sokalski
    njsokalski@hotmail.com
    http://www.nathansokalski.com/
  • Re: Controls inside UpdatePanel being duplicated on second click

    03-05-2008, 8:27 AM

    Hu Njsokalski,

    For convenience, would you pleas post a simple sample here so that we can reproduce your issue with your sample.  Thanks for understanding.

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)