I have a UserControl that contains contains a ModalPopupExtender. I need to set TargetControlID to a control that will exist on the parent page of the UserControl. Preferably I want this ID to exist as a property where the user can drop the control on the page and set the TargetControlID at design time. For some reason, I am getting a null reference when I execute the code. Here's a snippet of the code:
public partial class MyUserControl: System.Web.UI.UserControl
{
private string _targetControlID;
public string TargetControlID
{
get { return _targetControlID; }
set { _targetControlID = value; }
}
...
}
Here's the markup:
<uc1:MyUserControl ID="MyUserControl1" runat="server"
TargetControlID="OkButton" />
I'm guessing the ID is out of scope and probably needs to be mangled to refer to the containment hierachy. Any thoughts? Thanks in advance.