asp.net - How to find specific repeater item -
i have repeater , has asp button. want repeater item contains clicked button.
here part of repeater:
... <td> <asp:button runat="server" id="btnsavestock" onclick="btnsavestock_onclick" text="save" /> </td> </tr> </itemtemplate>
i want access repeater item in here :
protected void btnsavestock_onclick(object sender, eventargs e) { try { button btnsavestock = (button)sender; repeater rptproductchance = (repeater)btnsavestock.parent; } catch (exception) { throw; } }
what should expect loop check items of repeater?
this can do. can access repeateritem
casting buttons namingcontainer
.
protected void btnsavestock_onclick(object sender, eventargs e) { try { button btnsavestock = (button)sender; repeateritem item = (repeateritem)btnsavestock.namingcontainer; //.... } catch (exception) { throw; } }
Comments
Post a Comment