Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ASP.NET/C# - Modalpopup with listbox transferring data on button click

$
0
0

Hi guys, i have 2 issues right now.

First, i am trying to transfer data ,populated from the database, in the listbox to a 2nd listbox. But the problem im getting now is that after i click on the button to transfer the information over, the modalpopup closes.

Secondly, after i changed the selection mode in the listbox properties. Is there some form of checkbox or something which i can select on before i transfer its data over?

Any ideas? Thank you.

Here is my code behind: 

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ListBox1.DataSource = mBLL.LBModule();
            ListBox1.DataTextField = "ModuleName";
            ListBox1.DataValueField = "ModuleCode";
            ListBox1.DataBind();
        }
    }

protected void MoveRight_Click(object sender, EventArgs e) { for (int i = 0; i < ListBox1.Items.Count;i++) { if (ListBox1.Items[i].Selected) { ListBox2.Items.Add(ListBox1.Items[i]); ListBox1.Items.RemoveAt(i); } } } protected void MoveLeft_Click(object sender, EventArgs e) { for (int i = 0; i < ListBox2.Items.Count; i++) { if (ListBox2.Items[i].Selected) { ListBox1.Items.Add(ListBox2.Items[i]); ListBox2.Items.RemoveAt(i); } } }


 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>