In the past, I used jQuery Ajax to create a shopping cart. This time I use list view server management.
If I have a qty text box on each line and I want to update the quantity with a click of a button, is this the most elegant way to achieve this?
protected void Button1_Click(object sender, EventArgs e)
{
foreach(ListViewItem item in ListViewCart.Items)
{
foreach (Control con in item.Controls)
{
if (con.GetType() == typeof(TextBox))
{
}
}
}
}
I assume that I will need to store the product identifier in a user attribute for each text field and use it when updating the database. (Or write more code to find this value elsewhere on the line.)
More importantly, is there another server control that I can use instead? I do not want to use gridview.
source
share