我有一個名爲「DropDownList1」的下拉列表。從下拉列表中選取的任何值都不能刷新頁面,但只能刷新面板我的代碼如下。只刷新下拉框中的值更新
<asp:DropDownList ID="DropDownList1" runat="server" Width="200px" autopostback="true" OnSelectedIndexChanged="DropDownList1sel">
<asp:ListItem Text="abc" Value="0"></asp:ListItem>
<asp:ListItem Text="a" Value="1"></asp:ListItem>
<asp:ListItem Text="b" Value="2"></asp:ListItem>
<asp:ListItem Text="c" Value="3"></asp:ListItem>
</asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
當我運行這段代碼,它必須調用在「Label1的」填充了ascx.cs名爲「DropDownList1sel」的功能。現在頁面被刷新並且值被填充。我想要刷新面板而不重新加載頁面。請幫忙。
您嘗試過什麼碼?請用代碼編輯您的原始問題。 – Seany84
向我們展示了ascx.cs代碼的一部分 – Jegadeesh
您是否找到適合您問題的解決方案? – Seany84