简体   繁体   English

ASPX事件未触发

[英]ASPX event not firing

I just want to ask what's the problem in my codes here? 我只想问一下我的代码有什么问题? The OnSelectedIndexChanged event in #cbList is working fine but the ondrop event in #sortable2 is not working. #cbList中的OnSelectedIndexChanged事件运行正常,但#sortable2中的ondrop事件运行不正常。 I tried placing it inside and outside the update panel. 我尝试将其放在更新面板的内部和外部。 The code that is being called in the ondrop is in code behind. 在ondrop中调用的代码在后面的代码中。 It just change the dummyText's text. 它只是更改了dummyText的文本。 Here's my code: 这是我的代码:

<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

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

            <input type="hidden" runat="server" id="hdnSelectedValue" />
            <asp:CheckBoxList ID="cbList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="cbList_SelectedIndexChanged">
                <asp:ListItem Text="One" Value="1">
                </asp:ListItem>
                <asp:ListItem Text="Two" Value="2">
                </asp:ListItem>
                <asp:ListItem Text="Three" Value="3">
                </asp:ListItem>
                <asp:ListItem Text="Four" Value="4">
                </asp:ListItem>
                <asp:ListItem Text="Five" Value="5">
                </asp:ListItem>
            </asp:CheckBoxList>
            <br />
            <asp:Label ID="lblSelection" runat="server"></asp:Label>
            <asp:Label ID="dummyText" runat="server" Text="Here"></asp:Label>

            <ul id="sortable2" runat="server" class="connectedSortable" ondrop="Change_Text"></ul>

        </ContentTemplate>

    </asp:UpdatePanel>
</form>    

ondrop="" is client side event. ondrop=""是客户端事件。
You cannot wired up this event in code behind. 您无法在后面的代码中连接此事件。

Check this link for more information on OnDrop event 检查此链接以获取有关OnDrop事件的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM