How to Get Specific Button pressed in a repeater when using ModalPopupExtender

Posted by MemphisDeveloper on Stack Overflow See other posts from Stack Overflow or by MemphisDeveloper
Published on 2010-05-13T15:23:21Z Indexed on 2010/05/13 15:34 UTC
Read the original article Hit count: 290

I have buttons contained within a repeater. A ModalPopupExtender is used to confirm event for each button. I create standard panels outside of the repeater and I attach each button in the repeater to these panels from inside the repeater. The problem is once the button is pressed in the popup I can't figure out how to determine which row of the repeater to edit as I can't figure out how to identify which button was pressed. Panel:

<asp:Panel ID="pnlRemoveAlert" runat="server" >
<h1 align="center">Remove Phone</h1>
<asp:Button ID="butRemove" runat="server" OnCommand="Handle_Click" CommandName="Remove" Text="Continue"/>
<asp:Button ID="butRemoveCancel" runat="server" Text="Cancel"/>
</asp:Panel>

Repeater:

<asp:Repeater ID="repPhoneNumbers" runat="server" OnItemDataBound="setButtonModals"> 
<ItemTemplate>
...
<asp:Button ID="btnStatus" runat="server"/>
<asp:Button ID="dummybutton" runat="Server" Visible="false" /> 
<ajaxToolkit:ModalPopupExtender ID="mpeEnable" runat="server" TargetControlID = "btnStatus 
  CancelControlID="butEnableCancel"
  PopupControlID="pnlEnableAlert"/>
...

Event Handle:

Protected Sub Handle_Click(ByVal sender As Object, ByVal e As CommandEventArgs)
'I need to know which row of the repeater to deal with here
End Sub

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about modalpopupextender