In asp.net, you can drag and drop the Repeater control to sort and synchronize the sort of database fields,

Source: Internet
Author: User

In asp.net, you can drag and drop the Repeater control to sort and synchronize the sort of database fields,

There is a unit table in the database table that contains fields such as ID, Name, and Order. Now there is a background management function that allows you to set the display sequence of these units in certain statistical tables, so we thought of using the drag-and-drop method to make the operation easier.

An example animation is made using the GifCam software. The effect is shown in:

As a result, we found that the sortable function provided by jquery. ui can be used for sorting. The Repeater control is used from the units bound to the database on the interface. The following describes the main steps:

1. Click the jquery-1.7.2.min.js and jquery-ui.min.js used in the project to download the address: http://download.csdn.net/detail/taomanman/9315373

2. The TestDemo. aspx code is as follows:

<! DOCTYPE html> 

The TestDemo. cs code is as follows. The specific database operation class obtains data based on the actual situation, which is not detailed 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> // bind a ministry/organization // </summary> public void BindData () {string where = ""; string orderby = "F_Order ASC"; DataTable dt = bll. getData (where, orderby); this. rpt. dataSource = dt; this. rpt. dataBind ();}}

3. The update. aspx and update. aspx. cs codes of the $. ajax Method Request page are as follows:

<! DOCTYPE html> 

The above content is a small series of articles about how to use the Repeater control in asp.net to drag and drop to sort and synchronize the sorting of database fields.

Articles you may be interested in:
  • In ASP. NET, MVC transmits data from the background controller to the foreground view.
  • ASP. NET operations on txt files (read, write, and save)
  • Preview ASP. NET files in Word, Excel, and TXT files online
  • Simple implementation code for recording visitor page access IP addresses (asp.net + txt)
  • Asp.net: How to import data from a able to an Excel file and create a table
  • Asp.net implements Gradview binding database data and exporting Excel
  • Summary of ASP. NET database connection and data retrieval methods
  • Summary of several forms of MVC data transmission in ASP. NET
  • Asp.net: how to read data from a Txt file to a data view

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.