refresh an updatePanel in an other updatePanel

Discussion in 'ASP .Net' started by fran_j_diaz@yahoo.fr, Aug 6, 2007.

  1. Guest

    Hye,


    I've got some problems in developping web sites with Visual Studio
    2005 (ASP.net & C#) and the Microsoft Ajax library.

    In my webpage

    default.aspx

    I've got 2 update panels

    The 1rst contains all my components (labels, textboxes, a combobox and
    a 2nd update panel)


    The 2nd update panel contains a single combobox.

    The interest is when I change the first combobox index, the 2nd (which
    is in the 2nd update panel).

    But when I execute my program :


    I select an item in my first combo, and it refresh my second with
    right values.
    But when I select another item, the program does'nt do
    MyfirstCombo_OnSelectedIndexChanged and it does'nt refresh up2


    In aspx page :

    <asp:UpdatePanel id="up1" runat="server" UpdateMode="Conditional">
    <contenttemplate>
    .....
    <asp:combobox ID="MyfirstCombo" runat="server">
    <asp:UpdatePanel id="up2" runat="server"
    UpdateMode="Conditional">
    <contenttemplate>
    <asp:combobox ID="MySecondCombo"
    runat="server">
    </contenttemplate>
    <triggers>
    <asp:AsyncPostBackTrigger ControlID="MyfirstCombo"
    EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
    </triggers>
    </asp:UpdatePanel>

    <triggers>
    <asp:AsyncPostBackTrigger ControlID="MyButton"
    EventName="Click"></asp:AsyncPostBackTrigger>
    </triggers>
    </contenttemplate>
    <asp:Button ID="MyButton" runat="server" OnClick="MyButton_Click" />
    </asp:UpdatePanel>


    In aspx.cs page :

    MyfirstCombo.SelectedIndexChanged += new
    combobox.SelectedIndexChangedHandler(MyfirstCombo_OnSelectedIndexChanged);

    Please, Have you go a solution ?
     
    , Aug 6, 2007
    #1
    1. Advertising

  2. Rob Meade Guest

    <> wrote...

    > Please, Have you go a solution ?


    Try setting the following property:

    AutoPostBack = True

    to the first control which will cause the population on the second control.

    There's an article here for you, but its in vb rather than c#...

    <http://www.singingeels.com/Articles/Populating_Related_Drop_Down_Lists_With_AJAX.aspx>

    Regards

    Rob
     
    Rob Meade, Aug 6, 2007
    #2
    1. Advertising

  3. Guest

    <Rob Meade> wrote...
    > AutoPostBack = True
    >...
    > <http://www.singingeels.com/Articles/Populating_Related_Drop_Down_List...>



    Thanks a lot, It works !!!!!

    I put the 2 comboBoxes in the same update panel and I put
    autoPostBack="true" in the 1rst comboBox.
    I set ChildrenAsTriggers="false".

    Regards

    Akuma
     
    , Aug 6, 2007
    #3
  4. Rob Meade Guest

    <> wrote ...

    > Thanks a lot, It works !!!!!


    You're welcome :eek:)

    Regards

    Rob
     
    Rob Meade, Aug 8, 2007
    #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. wiertara
    Replies:
    0
    Views:
    389
    wiertara
    May 8, 2007
  2. Kika
    Replies:
    2
    Views:
    628
    bruce barker
    Jan 17, 2008
  3. Oleg
    Replies:
    3
    Views:
    402
    Arnab das
    Apr 1, 2008
  4. abcd

    UpdatePanel - full refresh

    abcd, Oct 2, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    722
    Hillbilly
    Oct 3, 2008
  5. Nathan Sokalski
    Replies:
    1
    Views:
    594
    miher
    Jun 15, 2009
Loading...

Share This Page