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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -