0

我不明白为什么这不会触发。它甚至不会调用该事件。有什么想法吗?我真正想做的是防止完全回发。页面很大,每次回帖都会跳到顶部。

<asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional">

    <ContentTemplate>

    <p>
        <asp:Label runat="server" ID="lblSnippet" AssociatedControlID="cmbSnippet">

            From snippet:

        </asp:Label>

        <asp:DropDownList runat="server" ID="cmbSnippet" CssClass="dropdown" AutoPostBack="true">
            <asp:ListItem>
                None
            </asp:ListItem>

            <asp:ListItem>
                Read Part
            </asp:ListItem>

            <asp:ListItem>
                Read Feed
            </asp:ListItem>
        </asp:DropDownList>

    </p>

    <!--Code-->

    <p>    
        <asp:Label runat="server" ID="lblCode" AssociatedControlID="txtCode">

            From code:

        </asp:Label>

        <asp:TextBox runat="server" ID="txtCode" TextMode="MultiLine" CssClass="editor" MaxLength="100" Height="200" Wrap="false" />
    </p>  

    </ContentTemplate>

    <Triggers>

         <asp:Asyncpostbacktrigger controlid="cmbSnippet" eventname="SelectedIndexChanged" />

    </Triggers>

</asp:UpdatePanel>
4

1 回答 1

0

你还没有像这样声明事件:

<asp:DropDownList runat="server" ID="cmbSnippet" CssClass="dropdown" AutoPostBack="true" OnSelectedIndexChanged="cmbSnippet_SelectedIndexChanged">

和他在代码隐藏中的相关处理程序......

于 2012-10-09T13:11:23.617 回答