Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
checkbox checked inside data list c#
Devendra Kumar
Sep 1 2016 1:28 AM
245
Reply
i have a form in which i will bind out off stock product in data list
and inside data list have check box
i want when which item checked then it convert into out of stock to available product
this is work properly but when first item checked then it convert into out of stock to available product but facing error like:
Collection was modified; enumeration operation may not execute.
and my code is like: on check box checkedchande
foreach
(
DataListItem
item
in
divProducts.Items)
{
Label
ProductId = (
Label
)item.FindControl(
"label_product"
);
CheckBox
chkbox = (
CheckBox
)item.FindControl(
"chkbox"
);
if
(chkbox.Checked)
{
objAdmin.OperationName =
"update_avail"
;
objAdmin.ProductId =
Convert
.ToInt16(ProductId.Text);
objAdmin.Pro_avail =
"Available";
objAdmin.Quantity = 30;
DataSet
ds = objAdmin.selectoutofstock();
BindGrid();
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to Update exist course id in EmployeeCourse table
Link button and gridview button not firing onclick and clik