将所选项目从列表框拖放到Asp.net中的文本框
问题描述:
我一直在努力为我的要求找到解决方案。我知道这在Windows应用程序中是可行的,但不知道Web应用程序。所以任何人都可以告诉我如何拖动下载到asp.net Web应用程序中的文本框?
我的Web应用程序需要的是,我有一个列表框,我希望用户选择单个或多个项目并从这个列表框中拖动它并将这些项目放到Asp.net.so中的文本框中。我怎么能在asp.net中这样做。
谢谢你advance。
Hi,
I'm stuck trying to find a solution for my requirement.I know this is possible in windows application but no idea about web application.So Can anyone tell me how to drag and drop to a text box in asp.net web application ?
What i need in my web application is, I have a list box and i want user select single or multiple items and drag it from this list box and drop those items to a text box in Asp.net.so how can i do it in asp.net.
Thanks in advance.
答
使用jqueryui工具包中的jQuery拖动。从那里你可以拖放任何元素并获取被拖动项目的属性并在被删除时使用它。
http://jqueryui.com/droppable/ [ ^ ]
在拖动完成的事件中,你接受拖动控件的任何属性,并放入掉落的控件
Use jQuery drag from the jqueryui toolkit. From that you can do drag-drop any element and take a property of the item being dragged and consume it upon being dropped.
http://jqueryui.com/droppable/[^]
In the drag completed event, you take in any property of the dragged control, and put in the dropped control