private void MoveSections() { int sectionId = Int32.Parse(Context.Request.QueryString["SectionId"]); Section section = (Section)CoreRepository.GetObjectById(typeof(Section), sectionId); section.Node = ActiveNode; if (Context.Request.QueryString["Action"] == "MoveUp") { section.MoveUp(); CoreRepository.FlushSession(); // reset sections, so they will be refreshed from the database when required. ActiveNode.ResetSections(); } else if (Context.Request.QueryString["Action"] == "MoveDown") { section.MoveDown(); CoreRepository.FlushSession(); // reset sections, so they will be refreshed from the database when required. ActiveNode.ResetSections(); } // Redirect to the same page without the section movement parameters Context.Response.Redirect(Context.Request.Path + String.Format("?NodeId={0}", ActiveNode.Id)); }