I know this has been asked numerous times, but after spending the best part of the day reading SO and other sites I am still unable to resolve my issue. I have tried playing about with Viewstate, !IsPostback, Page_Load and Page_Init all to no avail.
I have a repeater that returns a list of records and for each record it also displays two asp buttons. These buttons display an Ajax modalpopupextender. What is not happening is the Repeater ItemCommand is not being called so I cannot show the correct information in the text boxes.
I have placed the Ajax modalpopupextender is this correct? If not what do I need to do to get it to work.
Repeater Control
<div class="container">
<h2>Current Groups</h2>
<asp:Repeater ID="rptGroups" runat="server" OnItemCommand="rptGroups_ItemCommand" EnableViewState="false">
<HeaderTemplate>
<table class="table table-striped table-bordered">
<tr>
<td>GroupID</td>
<td>Group Name</td>
<td>Group Description</td>
<td></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem,"GroupID") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,"GroupName") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,"GroupDescription") %>
</td>
<td>
<asp:Button ID="btnEdit" runat="server" CssClass="btn btn-default" Text="Edit" CommandName="Edit" CommandArgument='<%#Eval("GroupID") %>' OnClick="btnEdit_Click" OnClientClick="return false" UseSubmitBehavior="false" />
<asp:Button ID="btnDelete" runat="server" CssClass="btn btn-danger" Text="Delete" CommandName="Delete" CommandArgument='<%#Eval("GroupID") %>' OnClick="btnDelete_Click" OnClientClick="return false" UseSubmitBehavior="false" />
<ajaxToolkit:ModalPopupExtender ID="mpeEdit" runat="server" PopupControlID="pnlEdit" TargetControlID="btnEdit"
CancelControlID="btnCloseEdit" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
<ajaxToolkit:ModalPopupExtender ID="mpeDelete" runat="server" PopupControlID="pnlDelete" TargetControlID="btnDelete"
CancelControlID="btnCloseDelete" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Code for popup
<asp:Panel ID="pnlDelete" runat="server" CssClass="modalPopup" align="center" Style="display: none">
<div style="height: 60px">
<asp:UpdatePanel ID="upnlDelete" runat="server">
<ContentTemplate>
<h4>Do you wish to delete this Group?</h4>
<asp:Label ID="lblDeleteGroupName" runat="server" ></asp:Label>
<asp:Label ID="lblDeleteGroupDesc" runat="server" ></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:Button ID="btnCloseDelete" runat="server" Text="Close" />
</asp:Panel>
Code for ItemCommand
protected void rptGroups_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
}
else if (e.CommandName == "Delete")
{
lblDeleteGroupName.Text = Convert.ToString(e.CommandArgument);
lblDeleteGroupDesc.Text = Convert.ToString(e.CommandArgument);
}
}
Thanks in advance
-- EDIT --
When I remove the ajaxToolkit:ModalPopupExtender from the repeater apart from the panel displaying on the page all the time, the postback works so I am thinking it has something to do with this, but I dont know where else I could place it