ReorderList数据源绑定(拖动更新数据库) (经本人测试,无法拖动!!)
来源:互联网 发布:越狱软件好 编辑:程序博客网 时间:2024/05/22 06:27
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI" TagPrefix="asp" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="w3.org/1999/xhtml" ><head runat="server"><title>无标题页</title><style type="text/css">.RLCss{line-height:30px;}.RLCss ul li{list-style-type:none;}.DivDragCss{width:800px; border:solid #CCCCCC 1px;cursor:move; margin-right:10px;height:25px;padding-left:10px;padding-bottom:10px;}</style></head><body><form id="form1" runat="server"><asp:scriptmanager runat="server"></asp:scriptmanager><div><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><cc1:ReorderList ID="ReorderList1" Width="100%" runat="server" AllowReorder="True" DataSourceID="SqlDataSource1"PostBackOnReorder="true" DataKeyField="id" SortOrderField="orderBy" ItemInsertLocation="Beginning" DragHandleAlignment="Left" ShowInsertItem="true" CssClass="RLCss"><ItemTemplate></ItemTemplate><EmptyListTemplate>Sorry!No resource to display!</EmptyListTemplate><DragHandleTemplate><div class="DivDragCss"><table width="800px;"><tr><td><%# Eval("showConent")%></td><Td style="width:30px; text-align:right;"><%# Eval("id")%></Td></tr></table></div></DragHandleTemplate><ReorderTemplate><asp:Panel ID="panReorderTmp" runat="server"><div style="width:800px; border:dashed red 1px;cursor:pointer;"> </div></asp:Panel></ReorderTemplate></cc1:ReorderList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"SelectCommand="SELECT * FROM [ReorderList] ORDER BY orderBy" OldValuesParameterFormatString="original_{0}"UpdateCommand="UPDATE [ReorderList] SET orderBy = @orderBy WHERE ID=@ID " ConflictDetection="CompareAllValues"><UpdateParameters><asp:Parameter Name="ID" Type="Int32" /></UpdateParameters></asp:SqlDataSource></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="ReorderList1" /></Triggers></asp:UpdatePanel></div></form></body></html>
数据库表
CREATE TABLE [dbo].[ReorderList] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[showConent] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[orderBy] [int] NULL
) ON [PRIMARY]
自己增上几条记录试试看呀!
- ReorderList数据源绑定(拖动更新数据库) (经本人测试,无法拖动!!)
- ReorderList数据源绑定(拖动更新数据库)
- 拖动
- 拖动
- 拖动
- 拖动
- SuperGridControl绑定数据源,同时更新数据库
- 桌面图标无法拖动
- openlayers features 无法拖动
- eclipse边框无法拖动
- DataGrid绑定数据显示列可拖动
- DataGrid绑定数据显示列可拖动
- UltraWebTree的递归绑定和节点拖动
- DataGrid绑定数据显示列可拖动
- C#TreeView数据绑定+拖动节点
- 拖动条(SeekBar)
- 拖动条(seekbar)
- 关于拖动(实现窗体拖动、不允许窗体拖动、任意控件运行时拖动)
- Qt的皮肤设计(Style Sheet)
- 第十六周 阅读程序13.11 输出文件流
- B2C电商怎么突围?定位、吸引力、互动!
- NHibernate属性和事件声明为virtual
- 内部联结:从多个表中选择数据
- ReorderList数据源绑定(拖动更新数据库) (经本人测试,无法拖动!!)
- 23种设计模式(8):观察者模式
- Entity Framework 学习
- 【关于ound.000文件夹的问题的解决办法】
- 黑马程序员_分支与循环中的变量作用域问题
- 23种设计模式(9):访问者模式
- SQL中N $ # @的作用
- 【加速吧】用户指南:巧用VOLANS路由器自带功能抗攻击
- 猴子管理法则