I have a repeater and it has an Asp button. I want to get repeater item which contains clicked button.
Here is a part of my repeater:
...
<td>
<asp:Button runat="server" ID="btnSaveStock" OnClick="btnSaveStock_OnClick" Text="Save" />
</td>
</tr>
</ItemTemplate>
I want to 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 I do expect loop as check all items of repeater?