database table has a unit table, which includes the ID, Name, order, and other fields, there is a background management function, you can set these units in some statistical tables in the order of display, so think of the drag-and-drop method to achieve, so that the operation easier.
Using the Gifcam software to do a sample animation, the effect is as shown in the following illustration:
So I started, and found that Jquery.ui provides sortable functions, which can be used for sorting, the interface from the database-bound units using the Repeater control, the following is a brief introduction to the main steps:
1, the project use of Jquery-1.7.2.min.js and jquery-ui.min.js please click to download, Address: http://download.csdn.net/detail/taomanman/9315373
2, Testdemo.aspx code is as follows:
The TestDemo.cs code is as follows, the concrete database operation class obtains the data according to the respective situation to carry on, does not have the detailed introduction here.
public partial class TestDemo:System.Web.UI.Page
{public
static GGJ_DC_DATACENTERBASEINFOBLL BLL = new Ggj_dc_ DATACENTERBASEINFOBLL ();
protected void Page_Load (object sender, EventArgs e)
{
if (! IsPostBack)
{
binddata ();
}
}
<summary>
///Binding Ministry Unit
///</summary> public
void Binddata ()
{
string where = " ";
String by = "F_order ASC";
DataTable dt = BLL. GetData (where, by);
This.rpt.DataSource = DT;
This.rpt.DataBind ();
}
3, the $.ajax method requests the page update.aspx and Update.aspx.cs code as follows:
The above is a small part of the introduction of the asp.net in the use of repeater control to drag and drop the implementation of the sorting and synchronization of database fields, I hope you like.