Hi, I get the following error when I try to add an ajax DragPanelExtender programatically.
The TargetControlID of '' is not valid. A control with ID 'ajaxPanel' could not be found.
Here's my code:-
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Panel ajaxPanel = new Panel();
ajaxPanel.ID = "ajaxPanel";
ajaxPanel.Height = 100;
ajaxPanel.Width = 100;
ajaxPanel.BorderColor = System.Drawing.Color.Brown;
AjaxControlToolkit.DragPanelExtender panelExtender = new AjaxControlToolkit.DragPanelExtender();
panelExtender.TargetControlID = ajaxPanel.UniqueID;
Page.Form.Controls.Add(panelExtender);
}
}
How do I fix this ?
Thanks.