c# - How to trigger Item_Command event for Checkbox in Repeater -
i having repeater contains check-boxes,i want fire item_command event whenever check-box on repeater checked. since item_command event wont fire check-box. googled , heard bubble event wont trigger check box,is there other way can achieve this?
thank you
askar
thanks @upvote markanswer did it... declared item_created event repeater , added following code,
protected void rptrincdnttype_itemcreated(object sender, repeateritemeventargs e) { repeateritem item = (repeateritem)e.item; if (item.itemtype == listitemtype.item || item.itemtype == listitemtype.alternatingitem) { checkbox chkbxsafety = item.findcontrol("chkbxsafety") checkbox; chkbxsafety.checkedchanged += new eventhandler(checkbox2_checkedchanged); } } private void checkbox2_checkedchanged(object sender,eventargs e) { checkbox cb = (checkbox)sender; }
Comments
Post a Comment