Is it possible to Drag and Drop Listitems from 1 DropDownlist to another DropDownlist with pure ASP.NET and C# without using javascript ?
2 Answers
No, this is not possible without javascript.
5 Comments
Hary
ok thanks. So when i move listitems from one list to another. Is it possible to track moved items in server side without passing those list items in hiddenfield ? any other way?
Darin Dimitrov
All you will get on the server is the final contents of the lists. If you want to keep track of what was moved you will need to use hidden fields or some other way to persist them using javascript during the drag'n'drop phase and pass this information to the server. Actually another possibility would be to persist the initial state of those lists on the server (using session or something) and then on postback you could compare the new values to the old ones and this way you would know which were moved.
Hary
"All you will get on the server is the final contents of the lists". Changes made in client does not reflect to server side. I am sorry i dint understand wat u meant ?
Hary
And Drag n Drop is from Client side and there is no postback with my dropdownlist now.
Darin Dimitrov
When you use javascript to make changes to your lists on the client you are basically modifying the DOM. When you postback to the server those changes will be sent to it. You will of course need to do postback at some stage in order for those changes to be sent to the server.
That is client-side behavior. ASP.NET is server-side technology. So no, it is not possible without JavaScript.
3 Comments
Hary
ok thanks. So when i move listitems from one list to another. Is it possible to track moved items in server side without passing those list items in hiddenfield ? any other way?
Hary
Actually i am creating multiple list dynamically and moving list items to them from a static list and finally i need to save those list items to database. How could i use AJAX here ?