1

私は通常のドロップダウンリストを持っています:

<asp:DropDownList ID="kindofser" runat="server" AutoPostBack="True" 
        Height="21px" Width="166px" 
        onselectedindexchanged="kindofser_SelectedIndexChanged">
        <asp:ListItem>שרתי משחק</asp:ListItem>
        <asp:ListItem Value="1">rgrgr</asp:ListItem>
        <asp:ListItem Value="2">rgreger</asp:ListItem>

    </asp:DropDownList>

オプションを変更するたびに SelectedIndexChanged イベントが発生しますが、ページは更新されます。それを止めることはできますか?

4

3 に答える 3

2

解決:

あなたの場合、「onselectedindexchanged」イベントを使用しているため、updatepanel を使用する必要があります。だからここにコード

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

<asp:DropDownList ID="kindofser" runat="server" AutoPostBack="True" 
        Height="21px" Width="166px" 
        onselectedindexchanged="kindofser_SelectedIndexChanged">
        <asp:ListItem>שרתי משחק</asp:ListItem>
        <asp:ListItem Value="1">rgrgr</asp:ListItem>
        <asp:ListItem Value="2">rgreger</asp:ListItem>
</asp:DropDownList>


</ContentTemplate>  
</asp:UpdatePanel>

よろしく
アリ・ムハンマド

于 2013-12-03T11:54:46.013 に答える
1

AutoPostBack="False"true の代わりに設定します。

于 2011-07-01T01:16:28.050 に答える