Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASPX事件未触发_C#_Asp.net_.net_Events_Html Lists - Fatal编程技术网

C# ASPX事件未触发

C# ASPX事件未触发,c#,asp.net,.net,events,html-lists,C#,Asp.net,.net,Events,Html Lists,我只是想问我的代码有什么问题?#cbList中的OnSelectedIndexChanged事件工作正常,但#sortable2中的ondrop事件不工作。我试着把它放在更新面板的内外。在ondrop中调用的代码位于代码隐藏中。它只是更改dummyText的文本。 这是我的密码: <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> &

我只是想问我的代码有什么问题?#cbList中的OnSelectedIndexChanged事件工作正常,但#sortable2中的ondrop事件不工作。我试着把它放在更新面板的内外。在ondrop中调用的代码位于代码隐藏中。它只是更改dummyText的文本。 这是我的密码:

<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=”“
    是客户端事件。
    您无法在代码隐藏中连接此事件


    其他信息:我有一个代码,可以使用.innerHtmlOh在#sortable2下动态插入
  • ,我知道了,有没有办法在服务器端做类似的事情?因为我正在使用“jquery sortable.js”执行一个可拖动的
  • s,所以我需要ondrop事件来重新排列它们的编号,这些编号显示为列表文本前面的一个标记。我怀疑您是否可以在服务器端执行此操作。最好与客户方合作。