binding data in list box control and retrieving the seleced value id
<p>I have list box control where I am binding the values to the listbox</p>

<pre><code>DataSet ds = new DataSet();
da.Fill(ds, "Employees");
ListBox1.DataSource = ds.Tables["Employees"].DefaultView; 
ListBox1.SelectedIndex = 0;
ListBox1.DataTextField = "FirstName";
ListBox1.DataValueField = "StaffID";
ListBox1.Databind();
</code></pre>

<p>after select ing the  value  .
I have button  once the user  clicks  this</p>

<pre><code>protected void BtnClick(object sender, EventArgs e)  
  {       
 var selectedItems = (from item in listBox.Items.Cast&lt;ListItem&gt;()     where item.Selected        select item.Text).ToArray();   
     result.Text = "You selected: ";    
   result.Text += string.Join(",", selectedItems); 
   }
</code></pre>

<p>Right now I    code inside the  event  gives me the  selected  vlaues  name.
  but I  want to get the  selected   values  index
ex</p>

<pre><code>ID  NAME
23  ram
34 tom
67 john
</code></pre>

<p>so  if I select  ram and  john
  in  code  behind  I  need  to get these  vales  ID that is 23,  67</p>

<p>Hope  my question is clear</p>

<p>Thank  you </p>
