UpdatePannel内容如何在“返回”后保持不变
页面中,有一个下拉列表框,有“aaa"和”bbb"项。
有一个UpdatePannel控件,其中有个LABLE控件。UpdatePannel的触发器为下拉列表框。
HTML代码如下:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True">aaa</asp:ListItem>
<asp:ListItem>bbb</asp:ListItem>
</asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="aaa"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
发现如下问题:
如果列表框的选项为"bbb",则Label文本变为"bbb";此时如果跳转到其他页面,再按“返回”按钮回来,则会出现列表框选项为"bbb",Label1内容变回“aaa"。
如何让UpdatePannel中的Label文本保持不变?