단추가 중계기 안에 있습니다. ModalPopupExtender는 각 단추의 이벤트를 확인하는 데 사용됩니다. 리피터 외부에 표준 패널을 만들고 리피터 안의 각 패널에 리피터의 각 버튼을 연결합니다. 문제는 팝업에서 버튼을 눌렀을 때입니다. 어떤 버튼을 눌렀는지 식별 할 수 없으므로 편집 할 행을 결정하는 방법을 알 수 없습니다. 패널 :ModalPopupExtender를 사용할 때 중계기에서 특정 단추를 누를 방법
<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>
리피터 :
<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"/>
...
이벤트 핸들 :
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
이 명령은 모달 패널에서 사용할 수 없기 때문에 해당 버튼을 클릭하면 모달 다이얼로그가 열리고 다른 버튼을 클릭하면 계속 진행됩니다. Cammand arg는 두 번째 버튼에서 어떻게 설정해야하는지 알 수 있지만 이벤트가 발생하기 전까지는 값을 알 수 없습니다. – NomadicDeveloper