Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8181307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:28:40+00:00 2026-06-07T00:28:40+00:00

I have two update panels on a page. And I want to update both

  • 0

I have two update panels on a page. And I want to update both of them conditions at different-2 conditions. But I don’t know why this is not happening. I have specified triggers for both but not helpful, below is my code.

Please let me know Where I am wrong.

Actually there are three dropdown lists in first update panel when their selectedindexchange is fired then the second update panel’s content also updates.

<asp:UpdatePanel ID="upSearch" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
    <ContentTemplate>
        <div style="float: left; width: auto;">

            <asp:DropDownList ID="ddlLocation" runat="server" Width="206px" DataTextField="LocationName"
                DataValueField="Locationid" AutoPostBack="true" OnSelectedIndexChanged="ddlLocation_SelectedIndexChanged">
            </asp:DropDownList>

            &nbsp;
            <asp:DropDownList ID="ddlArea" runat="server" Width="200px" DataTextField="AreaName"
                DataValueField="Areaid" AutoPostBack="true" OnSelectedIndexChanged="ddlArea_SelectedIndexChanged">
            </asp:DropDownList>

            &nbsp;
            <asp:DropDownList ID="ddlRoom" runat="server" Width="200px" DataTextField="RoomName"
                DataValueField="Roomid">
            </asp:DropDownList>
            &nbsp;

        </div>
        <div style="float: left; width: 80px;">
            <asp:Button ID="btnSearch" runat="server" Text="Search" ValidationGroup="vgSearch"
                CssClass="bluebtn" UseSubmitBehavior="false" OnClick="btnSearch_Click" />
        </div>
        <div style="float: left; width: 99%; padding: 5px 0px;">
        </div>
    </ContentTemplate>
  </asp:UpdatePanel>

And the second one is as follow:-

<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
    <asp:Calendar ID="calSchedule" runat="server" NextPrevFormat="FullMonth" OnDayRender="calSchedule_DayRender"
        OnVisibleMonthChanged="calSchedule_VisibleMonthChanged">
        <DayHeaderStyle CssClass="dayheaderStyle" />
        <NextPrevStyle />
        <OtherMonthDayStyle BackColor="#ffffff" />
        <SelectedDayStyle />
        <TitleStyle CssClass="titleStyle" />
        <TodayDayStyle BackColor="#ffffa0" ForeColor="#6699cc" />
        <WeekendDayStyle />
        <DayStyle CssClass="dayStyle" />
    </asp:Calendar>
</ContentTemplate>
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:28:41+00:00Added an answer on June 7, 2026 at 12:28 am

    First of all I would like to recall the use of UpdateMode

    • Always The panel will update its content on every post on the page, they can be partial rendering posts or full posts, in both cases the content of the panel will be updated

    • Conditional The content of the panel will only be updated when different conditions are met:

      • By default the events triggered by its child objects will trigger an update, you can change this behavior setting ChildrenAsTriggers="false"

      • When you declare a trigger in the Triggers section of the UpdatePanel

      • When you explicitly call the UpdatePanel.Update() method

      • Full page posts will trigger the update

    The following code does the following:

    • Each UpdatePanel is updated when its child controls raise an event

    • The UpdatePanel 1 named: up1 will be updated only when its child controls raise an event

    • The UpdatePanel 2 named up2 will be updated when its child controls raise an event

    • The UpdatePanel 2 named up2 will also be updated when the triggers defined are fired, in this case, when the DropDownList named ddl1OnPanel1 on the UpdatePanel 1 fires its SelectedIndexChanged

    • The UpdatePanel 2 named up2 will also be updated when the DropDownList named ddl2OnPanel1 on the UpdatePanel 1 raises its SelectedIndexChanged, because in code it explicitly calls: this.up2.Update();

    I think that tweaking this code, you could achieve your desired goal, just copy paste it on a new page and run it

    Check the following code (see how the labels showing the date are affected in different ways depending on the events raised):

    Code Behind

        protected void ddl1OnPanel1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.lblMessageOnPanel1.Text = "From ddl1 " + DateTime.Now.ToString();
            this.calendarOnPanel2.SelectedDate = DateTime.Today.AddDays(1);
            this.lblMessageOnPanel2.Text = "From ddl1 " + DateTime.Now.ToString();
        }
    
        protected void ddl2OnPanel1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.lblMessageOnPanel1.Text = "From ddl2 " + DateTime.Now.ToString();
            this.calendarOnPanel2.SelectedDate = DateTime.Today.AddDays(2);
            this.lblMessageOnPanel2.Text = "From ddl2 " + DateTime.Now.ToString();
            this.up2.Update();
        }
    

    ASPX

        <asp:ScriptManager runat="server" ID="scriptManager" />
        <asp:Button Text="Full Post" runat="server" />
        <br />
        <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:DropDownList runat="server" ID="ddl1OnPanel1" AutoPostBack="true" OnSelectedIndexChanged="ddl1OnPanel1_SelectedIndexChanged">
                    <asp:ListItem Text="text1" />
                    <asp:ListItem Text="text2" />
                </asp:DropDownList>
                <br />
                <asp:DropDownList runat="server" ID="ddl2OnPanel1" AutoPostBack="true" OnSelectedIndexChanged="ddl2OnPanel1_SelectedIndexChanged">
                    <asp:ListItem Text="text3" />
                    <asp:ListItem Text="text4" />
                </asp:DropDownList>
                <br />
                <asp:Label runat="server" ID="lblMessageOnPanel1" />
                <br />
                <asp:Button ID="Button1" Text="text" runat="server" />
                <br />
                On every post on Panel 1: <%:DateTime.Now %>
            </ContentTemplate>
        </asp:UpdatePanel>
    
        <br />
        <br />
        <asp:UpdatePanel runat="server" ID="up2" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Calendar ID="calendarOnPanel2" runat="server" >
                    <DayHeaderStyle CssClass="dayheaderStyle" />
                    <NextPrevStyle />
                    <OtherMonthDayStyle BackColor="#ffffff" />
                    <SelectedDayStyle />
                    <TitleStyle CssClass="titleStyle" />
                    <TodayDayStyle BackColor="#ffffa0" ForeColor="#6699cc" />
                    <WeekendDayStyle />
                    <DayStyle CssClass="dayStyle" />
                </asp:Calendar>
                <br />
                <asp:Label ID="lblMessageOnPanel2" runat="server" />
                <br />
                On every post On Panel 2: <%:DateTime.Now %>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddl1OnPanel1" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    

    Simple Output

    enter image description here

    You could change the UpdateMode="Always" on the UpdatePanel 2, to see the difference, if you do it, this panel will be updated on every post, either full posts or posts coming from the UpdatePanel1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have scenario, I have two update panels on the page (both have update
I have two update panels at my ajax page. This is first time I'm
I have added two update panels to my page. I'm trying to update the
I have two update panels on my page. The first has a form that
I have two panels in update panel. In panel1, there is button. If I
I have two tables nol_art and #tmpIzm I want to update nol_art with value
On my MasterPage I have 2 update panels which are surrounded with Panels. Two
I have two UpdatePanels and two Timers to update them, the Timers' interval are
i have two update panels as follows (when linkbutton is clicked i'm trying to
I have an UpdatePanel with two ListBoxes in them. What I want to happen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.