<asp:Panel CssClass="AcknowledgeContainer" 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" CssClass="btn" Text="Cancel"/>
</asp:Panel>
<asp:Panel CssClass="AcknowledgeContainer" ID="pnlDisableAlert" runat="server" >
<h1 align="center">Temporarily Disable Phone</h1>
<asp:Button ID="butDisable" runat="server" OnCommand="Handle_Click" CommandName="Disable" Text="Continue" />
<asp:Button ID="butDisableCancel" runat="server" Text="Cancel" />
</asp:Panel>
<asp:Panel CssClass="AcknowledgeContainer" ID="pnlEnableAlert" runat="server" >
<h1 align="center">Re-Enable Phone</h1>
<asp:Button ID="butEnable" runat="server" OnCommand="Handle_Click" CommandName="Enable" Text="Continue" />
<asp:Button ID="butEnableCancel" runat="server" Text="Cancel" />
</asp:Panel>
...
<asp:Repeater ID="repPhoneNumbers" runat="server" OnItemDataBound="setButtonModals">
<ItemTemplate>
<asp:Label ID="lbl005108002" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "P_Number")%>'></asp:Label>
<asp:Button ID="btnStatus" runat="server"/>
<asp:Button ID="btnRemove" runat="server"/>
<asp:Button ID="dummybutton" runat="Server" Visible="false" />
<ajaxToolkit:ModalPopupExtender ID="mpeEnable" runat="server"
CancelControlID="butEnableCancel"
PopupControlID="pnlEnableAlert">
</ajaxToolkit:ModalPopupExtender>
<ajaxToolkit:ModalPopupExtender ID="mpeDisable" runat="server"
CancelControlID="butDisableCancel"
PopupControlID="pnlDisableAlert">
</ajaxToolkit:ModalPopupExtender>
<ajaxToolkit:ModalPopupExtender ID="mpeRemove" runat="server"
TargetControlID="btnRemove"
PopupControlID="pnlRemoveAlert"
CancelControlID="butRemoveCancel">
</ajaxToolkit:ModalPopupExtender>
</ItemTemplate>
</asp:Repeater>
...
Protected Sub setButtonModals(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
With e.Item
If .ItemType = ListItemType.Item Or .ItemType = ListItemType.AlternatingItem Then
Dim status As String = .DataItem("P_Status").ToString
Select Case status
Case "Disabled"
CType(.FindControl("btnStatus"), Button).Text = "Enable this Phone"
With CType(.FindControl("mpeEnable"), ModalPopupExtender)
.TargetControlID = "btnStatus"
End With
CType(.FindControl("mpeDisable"), ModalPopupExtender).TargetControlID = "dummybutton"
Case "Enabled"
CType(.FindControl("btnStatus"), Button).Text = "Disable this Phone"
CType(.FindControl("mpeEnable"), ModalPopupExtender).TargetControlID = "dummybutton"
CType(.FindControl("mpeDisable"), ModalPopupExtender).TargetControlID = "btnStatus"
End Select
End If
End With
End Sub
...
Protected Sub Handle_Click(ByVal sender As Object, ByVal e As CommandEventArgs)
'Here I would like to be able to identify which row in the repeater needs to be changed.
End Sub
|