Save sorted ListBox Items??
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from a SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstBox1.SelectedIndex; string str = lstBox1.SelectedItem.ToString(); if (i > 0) { lstBox1.Items.RemoveAt(i); lstBox1.Items.Insert(i - 1, str); lstBox1.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from a SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstBox1.SelectedIndex; string str = lstBox1.SelectedItem.ToString(); if (i > 0) { lstBox1.Items.RemoveAt(i); lstBox1.Items.Insert(i - 1, str); lstBox1.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
Sorry forgot to mention, I need to have these 2 pages. Everything one 1 page is not suitable in my case. Many Thanks
------------------- Redcastle CRM
-
Sorry forgot to mention, I need to have these 2 pages. Everything one 1 page is not suitable in my case. Many Thanks
------------------- Redcastle CRM
What you need to do is save this information(of ordering done at Sort Page) in your database.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from a SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstBox1.SelectedIndex; string str = lstBox1.SelectedItem.ToString(); if (i > 0) { lstBox1.Items.RemoveAt(i); lstBox1.Items.Insert(i - 1, str); lstBox1.SelectedIndex = i - 1; } } ------------------- Redcastle CRM