My dynamically added modal popup extender can't find the target control ID. I'm using master pages.
EDIT: It works great without MasterPages.
Web Form:
<asp:Content ID="Content3" ContentPlaceHolderID="cphContent" runat="server">
<a runat="server" href="javascript:void(0);" ID="btnVote">vote</a>
<asp:Panel ID="popScore" runat="server"></asp:Panel>
</asp:Content>
CodeBehind
protected void Page_Load(object sender, EventArgs e)
{
ModalPopupExtender mpeScore = new ModalPopupExtender()
{
ID = "mpeSc",
PopupControlID = popScore.ClientID,
TargetControlID = btnVote.ClientID,
BackgroundCssClass = "modalBackground",
BehaviorID = "mpeScore"
};
this.Controls.Add(mpeScore);
}
Error message is
The TargetControlID of 'mpeSc' is not valid. A control with ID 'ctl00_cphContent_btnVote' could not be found.
I tried btnVote.ID
also.