Reputation: 1443
I have am generating a listView that looks like this
Now, on the click of the "Add To Briefcase" button, I need to go though the each item and email the once where user has entered quantity.
I saw I can do something like this
foreach (var item in productFormsView.Items)
{
var somevalue = ((Form)item.DataItem).Quantity;
}
However, item.DataItem is returning null as below. How do I get the text from "QUANTITY" textboxes?
Upvotes: 1
Views: 1064
Reputation: 124
when you click the button. there was a new request come to your web server.the productFormsView will be init,so the item is null. you can save the quantity data in some hidden filed by javascript when you click the button, and get the quantity from Request.Form["xxx"]
Upvotes: 1