I realize that this question may have been asked before... But I have a specific problem with this...
my code
foreach(ListViewItem item in listProducts.Items)
{
DropDownList dropList = listProducts.Items.FindControl("DropDownList1");
int SelectedID = Convert.ToInt32(listProducts.SelectedValue);
}
// now do something with that id...
The problem is that I lose the ID of the selected item from dropdown list once the foreach loop goes through the listview items...
I'm using this code in selectedindexchanged dropdown event to locate the desired ID and so that I may display the data to the user accordingly to what he selected from dropdown list...
So the idea is that when the user selects something from the drop down, i need to pick up the ID of the selected item and automatically display the product price when he selects it.
Can someone help me to solve this?
Aucun commentaire:
Enregistrer un commentaire