using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Admin_SortContactFormFields : WebBlocks.AdministrativePage { private int ContactFormID { get { return (ViewState["ContactFormID"] == null ? 0 : (int)ViewState["ContactFormID"]); } set { ViewState["ContactFormID"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request["ContactFormID"] != null) ContactFormID = Int32.Parse(Request["ContactFormID"]); if (ContactFormID > 0) BindData(); } } private void BindData() { DataTable dt = Database.ContactFormFields_GetByContactFormID(ContactFormID); SortableList1.DataSource = dt; SortableList1.DataBind(); } protected void btnCancel_Click(object sender, EventArgs e) { Response.Redirect("EditContactForm.aspx?ContactFormID=" + ContactFormID.ToString()); } protected void btnSave_Click(object sender, EventArgs e) { Database.ContactFormFields_UpdateSort(SortableList1.GetValueOrderList()); Response.Redirect("EditContactForm.aspx?ContactFormID=" + ContactFormID.ToString()); } }