我在一个页面上有两个更新面板。我想在不同的 2 条件下更新这两个条件。但我不知道为什么这没有发生。我已经为两者指定了触发器,但没有帮助,下面是我的代码。
请让我知道我错在哪里。
实际上,当它们的 selectedindexchange 被触发时,第一个更新面板中有三个下拉列表,然后第二个更新面板的内容也会更新。
<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>
<asp:DropDownList ID="ddlArea" runat="server" Width="200px" DataTextField="AreaName"
DataValueField="Areaid" AutoPostBack="true" OnSelectedIndexChanged="ddlArea_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlRoom" runat="server" Width="200px" DataTextField="RoomName"
DataValueField="Roomid">
</asp:DropDownList>
</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>
第二个如下:-
<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>