<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ReorderList ID="ReorderList1" runat="server"
                onitemreorder="ReorderList1_ItemReorder">
                <DragHandleTemplate>
                 <div style="width:30px; height:25px; cursor:move" />
                </DragHandleTemplate>
                <ReorderTemplate>
                  <div style="width:100%; height:25px; border:dashed thin black;" />
                </ReorderTemplate>
                <ItemTemplate>
                  <asp:Label ID="ItemLabel" runat="server" Text='<%#Eval("description") %>' />  
                </ItemTemplate>
            </asp:ReorderList>
        </ContentTemplate>
       
        </asp:UpdatePanel>

protected void ReorderList1_ItemReorder(object sender, AjaxControlToolkit.ReorderListItemReorderEventArgs e)
        {
            string strCnn = "Server=10.16.33.20;Database=MyRoleTest;User ID=sa;Password=123456;Pooling=true; MAX Pool Size=512;Min Pool Size=5;Connection Lifetime=30 ";

SqlConnection conn = new SqlConnection(strCnn);

//string sql = "update ajax set position='" + e.NewIndex + "'  where position='" + e.OldIndex + "'";
            string sql = "";

sql = " update AJAX set position=-999 where position=" + e.OldIndex +";";
                if (e.NewIndex > e.OldIndex)
                {
                    sql = sql + "  update AJAX set position=position-1 where position>" + e.OldIndex + " and position<=" + e.NewIndex + "; ";
                }
                else if (e.NewIndex < e.OldIndex)
                {
                    sql = sql + "  update AJAX set position=position+1 where position>=" + e.NewIndex + " and position<" + e.OldIndex + "; ";
                }
                //sql = sql + " update AJAX set position=" + e.NewIndex + " where position=" + e.OldIndex + " ;";
                sql = sql + " update AJAX set position=" + e.NewIndex + " where position=-999 ;";

SqlCommand cmd = new SqlCommand(sql, conn);
            conn.Open();

cmd.ExecuteNonQuery();

cmd.Dispose();
            conn.Dispose();

//NewMethod();
        }

ReorderList 的使用的更多相关文章

  1. Leetcode ReorderList

    Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do thi ...

  2. reorderList使用

    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" /> ...

  3. leetcode — reorder-list

    /** * Source : https://oj.leetcode.com/problems/reorder-list/ * * Given a singly linked list L: L0→L ...

  4. reorder-list 单链表

    题意: 给你一个单链表 a1 a2 a3 a4 a5....an 让你变成 a1 an a2 an-1 a3 an-2 .... 这里牵涉到,单链表的倒置和两个单链表的合并. class Soluti ...

  5. reorder-list——链表、快慢指针、逆转链表、链表合并

    Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do thi ...

  6. reorder-list leetcode C++

    Given a singly linked list L: L 0→L 1→-→L n-1→L n, reorder it to: L 0→L n →L 1→L n-1→L 2→L n-2→- You ...

  7. [LeetCode] Reorder List 链表重排序

    Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do th ...

  8. leetcode算法分类

    利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problem ...

  9. BUG-FREE-For Dream

    一直直到bug-free.不能错任何一点. 思路不清晰:刷两天. 做错了,刷一天. 直到bug-free.高亮,标红. 185,OA(YAMAXUN)--- (1) findFirstDuplicat ...

随机推荐

  1. SAP模块常用增强总结{转载}

    MM模块: 采购订单增强: BADI :ME_GUI_PO_CUST ME_PROCESS_PO_CUST 物料凭证增强: BADI:MB_DOCUMENT_BADI USER-EXIT:MBCF00 ...

  2. Windows Store App 关键帧动画

    关键帧动画和插值动画类似,同样可以根据目标属性值的变化产生相应的动画效果,不同的是,插值动画是在两个属性值之间进行渐变,而关键帧动画打破了仅通过两个属性值控制动画的局限性,它可以在任意多个属性值之间进 ...

  3. [转]Jenkins Xcode打包ipa

    本地打包. 如果Mac 上没有安装brew.先安装:ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/ins ...

  4. XML 链接

    公共Webservice   网络上可供测试的Web Service腾讯QQ在线状态 WEB 服务Endpoint: http://www.webxml.com.cn/webservices/qqOn ...

  5. Material Design之TextInputLayout使用示例

    Google在2015的IO大会上,给我们带来了更加详细的Material Design设计规范,同时,也给我们带来了全新的Android Design Support Library,在这个supp ...

  6. 动态获取Android权限

    @TargetApi(23)private void showPhotoDialog() { if (dialog != null && dialog.isShowing()) { d ...

  7. php大力力 [039节] 修改一下后台项目,同时启用印象笔记,要做的事情todo列表,记录在印象笔记,速度快一些

    php大力力 [039节]  修改一下后台项目,同时启用印象笔记,要做的事情todo列表,记录在印象笔记,速度快一些

  8. cortex-a8硬件基础练习

    实验要求:定时通过串口打印adc,时间和温度,开关量检测和通过串口接收命令控制led小灯的动作 下面是整理的代码: #include "s5pc100.h"#include &qu ...

  9. Centos搭建SVN服务器三步曲

    搭建SVN服务,有效的管理代码,以下三步可以快速搞定.1.安装 #yum install subversion 判断是否安装成功#subversion -v svnserve, version 1.6 ...

  10. 《JavaScript模式》第4章 函数

    @by Ruth92(转载请注明出处) 第4章:函数 一.JavaScript 中函数的两个重要特征 函数是第一类对象,可以作为带有属性和方法的值以及参数进行传递: 函数提供了局部作用域,而其他大括号 ...