Unable to save ListBox Items in sorted order
In my .NET web forms page, I have a ListBox and some jQuery that allows me to sort the items.  I select several items and then loop over them to save to my database.  I want to save the order the items are sorted in, however, I am unable to get it to work.  My codebehind is shown:

		protected void session_DetailsView_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
		{
			panel_SqlDataSource.Delete();
			ListBox panel_ListBox = session_DetailsView.FindControl("panel_ListBox") as ListBox;
			int so = 0;
			for (int i=0; i < panel_ListBox.Items.Count; i++)
			{
				if (panel_ListBox.Items[i].Selected == true)
				{
					so++;
					panel_SqlDataSource.InsertParameters["presenterID"].DefaultValue = panel_ListBox.Items[i].Value;
					panel_SqlDataSource.InsertParameters["sortOrder"].DefaultValue = so.ToString();
					panel_SqlDataSource.Insert();
				}
			}
		}
Unable to save ListBox Items in sorted order
===

In my .NET web forms page, I have a ListBox and some jQuery that allows me to sort the items.  I select several items and then loop over them to save to my database.  I want to save the order the items are sorted in, however, I am unable to get it to work.  My codebehind is shown:

		protected void session_DetailsView_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
		{
			panel_SqlDataSource.Delete();
			ListBox panel_ListBox = session_DetailsView.FindControl("panel_ListBox") as ListBox;
			int so = 0;
			for (int i=0; i < panel_ListBox.Items.Count; i++)
			{
				if (panel_ListBox.Items[i].Selected == true)
				{
					so++;
					panel_SqlDataSource.InsertParameters["presenterID"].DefaultValue = panel_ListBox.Items[i].Value;
					panel_SqlDataSource.InsertParameters["sortOrder"].DefaultValue = so.ToString();
					panel_SqlDataSource.Insert();
				}
			}
		}