views:

45

answers:

2

Hello I am needing to create an unordered list that uses jquery to make it sortable.

I want something like is shown here

How would I do this with ASP.Net? I thought I could just use almost nothing but HTML but it turns out that I need TextBox controls to be in each <li>

How would I most easily do this?

A: 

I'd use jQuery UI. It looks like this is pretty much what you're looking for:

http://jqueryui.com/demos/sortable/

Putting a TextBox inside the <li> shouldn't make a difference, the list will still be sortable

Jimmy
I am using jQuery UI. The point is not doing this in HTML, but doing it with ASP.Net controls.
Earlz
Ah yes, well in that case then Canavar's suggestion is the best way to go. You can put the opening ul tag either in the <headertemplate> section or outside the repeater, and the closing ul tag either in the <footertemplate> section or outside of the repeater. Sorry I misunderstood you initially
Jimmy
Using ASP.NET, how did you store the ordering of the sortable list on post-back?
jamiebarrow
A: 

I think you can use Repeater control that has <li> and the TextBox controls in it's template.

Canavar
You could also use a ListView with the layout template having a <ul> and the item template having a <li>.
jamiebarrow