日期:2014-05-17 浏览次数:21091 次
<ul id="list1">
<li liid="6"></li>
<li liid="2"></li>
<li liid="3"></li>
<li liid="4"></li>
<li liid="1"></li>
<li liid="8"></li>
<li liid="7"></li>
</ul>
<script type="text/javascript">
$("#list1").dragsort({ dragSelector: "div", dragEnd: saveOrder, placeHolderTemplate: "<li class='placeHolder'><div></div></li>" }); function saveOrder() {
var data;
$("#list1 li").each(function(i){
data.push("{'liid':$(this).attr('liid'),'index':i}");
})
$.ajax({ url: "Default.aspx/SaveListOrder", data: '{ids:["' + data.join('","') + '"]}', dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" }); }; </script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ClientIDMode="Inherit" >
<ContentTemplate>
<ol id="list1" >
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2"
onitemcommand="Repeater1_ItemCommand">
<ItemTemplate>
<li data-itemid='<%# Container.ItemIndex %>' >
<div&