在我的 asp.net 解决方案中,我正在尝试使用 Listbox 拖放功能(例如在此示例中:http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/draganddrop/defaultcs.aspx )。但是我现在遇到的问题是拖放不起作用。而不是拖动它的标记项目...我试图将 html 直接复制到我的页面,但它仍然无法正常工作。有什么想法有什么问题吗?
是因为我想念 CSS 吗?
看法:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!-- ## HEAD SECTION ## -->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentToolbar" runat="server">
<!-- ## SCRIPT MANAGER ## -->
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Scripts>
<asp:ScriptReference Path= "~/Scripts/jquery-1.2.6.pack.js" />
</Scripts>
</asp:ScriptManagerProxy>
<%if(false) {%>
<script src="../../Scripts/jquery-1.2.6-vsdoc.js" type="text/javascript"></script>
<%} %>
<!-- ## AJAX MANAGER ## -->
<!-- ## AJAX MANAGER ## -->
<telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">
</telerik:RadAjaxManager>
<!-- ## TOOLBAR ## -->
<telerik:RadToolBar ID="RadToolBar1" runat="server"
OnButtonClick="Toolbar_ButtonClick"
EnableEmbeddedSkins="False"
OnClientButtonClicked="OnClientButtonClicked"
CssClass="pickers_width"
Skin="AgendaSkin">
<Items>
<telerik:RadToolBarButton AccessKey="<%$ Resources:Shortcuts, GLOBAL_SAVE %>"
PostBack="false"
Text="<%$ Resources:Language, Generel.Expression.SaveAndClose %>"
CommandName="SAVEANDCLOSE"
Value="SAVEANDCLOSE"
ImageUrl="~/Images/Icons/save_16.png"></telerik:RadToolBarButton>
<telerik:RadToolBarButton AccessKey="<%$ Resources:Shortcuts, POPUPS_RETURN %>"
PostBack="False"
Text="<%$ Resources:Language, Generel.Expression.Close %>"
CommandName="CLOSE"
ImageUrl="~/Images/Icons/close_16.png"></telerik:RadToolBarButton>
</Items>
</telerik:RadToolBar>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentHeader" runat="server">
<!-- ## HEADER (TITLE BAR) ## -->
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentWorkspace" runat="server">
<div class="pickers_workspace_row_margin">
<!-- ## WORKSPACE ## -->
<div class="prof_item">
<asp:Panel ID="pnlRoleList" runat="server" CssClass="prof_item_value_section">
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" CssClass="example-panel">
<telerik:RadListBox ID="RadListBox1" runat="server" Width="200px" Height="200px"
SelectionMode="Single" AllowReorder="true"
EnableDragAndDrop="true" OnDropped="RadListBox1_Dropped">
</telerik:RadListBox>
</telerik:RadAjaxPanel>
</asp:Panel>
</div>
</div>
<asp:HiddenField runat="server" ID="hidRoleInObjectUId" />
<asp:HiddenField runat="server" ID="hidRoleInObjectName" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentScripts" runat="server">
<!-- ## SCRIPT SECTION ## -->
<script type="text/javascript" language="javascript">
function CloseWindow() {
// Return userdata to calling window
if (window.opener != null) {
window.opener.ClearBlocker();
window.ReturnFunction();
window.close();
}
}
function SaveEditedFields(commandName) {
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.ajaxRequest(commandName);
}
function OnClientButtonClicked(sender, args) {
var button = args.get_item();
var commandName = args.get_item().get_commandName()
switch (commandName) {
case "SAVEANDCLOSE":
SaveEditedFields(commandName);
break;
case "SAVE":
SaveEditedFields(commandName);
break;
case "CLOSE":
CloseWindow();
break;
}
}
</script>
</asp:Content>
CS :
private void FillMandatoryItemFirstList(Guid item_guid)
{
//MandatoryItems First
IEnumerable<MandatoryItem> mandatoryFirst = MandatoryItem.GetMandatoryItemByCommitteeAndPos(item_guid, Enums.GetGuidFromEnum(Enums.AgendaElementPositionEnum.PosFirst));
foreach (var item in CheckCount(mandatoryFirst))
{
RadListBox1.Items.Add(new RadListBoxItem(item.UIdHandlingItemHandlingItem.Title, item.Id.ToString()));
}
}