0
I wonder how the value of a checkbox
which in turn is inside a DataList
which is inserted within a View
and the latter within a MultiView
.
I tried some methods FindControl
but without success.
0
I wonder how the value of a checkbox
which in turn is inside a DataList
which is inserted within a View
and the latter within a MultiView
.
I tried some methods FindControl
but without success.
Browser other questions tagged asp checkbox view value
You are not signed in. Login or sign up in order to post.
Like you tried when you did for Findcontrol?
– Maicon Carraro
@Maicon Carraro
CheckBox cb = FindControl("ckBoxStock") as CheckBox;
LinkButton lb = FindControl("linkBtnAddCart") as LinkButton;

if (cb.Checked != true)
{

 lb.Enabled = false;

}
– Chirag Geiantilal
This way I tested but without success.
foreach (DataListItem item in DataListProdutosGridView.Items)
 {
 CheckBox ckBoxStock = (CheckBox)item.FindControl("ckBoxStock");
 LinkButton linkBtnAddCart = (LinkButton)item.FindControl("linkBtnAddCart");
 if (ckBoxStock.Checked)
 {
 linkBtnAddCart.Enabled = true;
 }

 else

 {
 linkBtnAddCart.Enabled = false;
 }
 }
– Chirag Geiantilal
Can someone help me?
– Chirag Geiantilal
Try putting
var cb = SuaMultiView.FindControl("ckBoxStock") as CheckBox;
– Maicon Carraro