C# ASPX事件未触发
我只是想问我的代码有什么问题?#cbList中的OnSelectedIndexChanged事件工作正常,但#sortable2中的ondrop事件不工作。我试着把它放在更新面板的内外。在ondrop中调用的代码位于代码隐藏中。它只是更改dummyText的文本。 这是我的密码: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"> &
<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下动态插入