I have a user control MembersFoundControl.ascx that is loaded into the MembersControl.ascx when duplicate members are found. The MembersFoundControl control definition is:
<%@ Control Language="C#" AutoEventWireUp="true" CodeBehind="MembersFoundControl.ascx.cs" Inherits="MemberTrack2016.ControlClasses.MembersFoundControl" %>
It is registered in MembersControl as:
<%@ Register Src="~/ControlClasses/MembersFoundControl.ascx" TagPrefix="mfctrl" TagName="MembersFoundControl" %>
It is loaded into a placeholder in the MembersControl as
MembersFoundControl memberListControl = LoadControl("~/ControlClasses/MembersFoundControl.ascx") as MembersFoundControl;
MembersFoundPlaceholder.Controls.Add(memberListControl);
the control events are defined in the MembersFoundControl as:
<div id="MemberListActionDiv" class="ButtonDivStyle" style="width: 36em; padding-top: 1em; padding-bottom: 0.5em">
<asp:button id="UseNewMemberButon" cssclass="MemberButtonStyleLarge" text="Use New Member" runat="server" onclick="OnUseNewMember">
<asp:button id="MFC_CancelButton" cssclass="MemberButtonStyle" text="Cancel" runat="server" onclick="OnMFCCancel" style="margin-left: .625em">
</div>
And the Event operations are in the MembersFoundControl.ascx.cs file
protected void OnUseNewMember(object sender, EventArgs e)
{
MembersFoundEventArgs args = new MembersFoundEventArgs();
args.nRetType = IDUSENEWMEMBER;
args.MemberRec = null;
args.nRelation = nRelationType;
onUseThisMember(this, args);
}
protected void OnMFCCancel(object sender, EventArgs e)
{
MembersFoundEventArgs args = new MembersFoundEventArgs();
args.nRetType = IDCANCEL;
args.MemberRec = null;
args.nRelation = nRelationType;
onUseThisMember(this, args);
}
When the control is loaded in the place holder the buttons are named and given the ids as follows:
<div id="MemberListActionDiv" class="ButtonDivStyle" style="width: 36em; padding-top: 1em; padding-bottom: 0.5em"></div>
The event is not fired in either MembersFoundControl or in MembersControl.
This is built in Visual Studio 2017 (2019 has problems).
Does anyone have any suggestions? THANKS
What I have tried:
I have tried everything I can think of.