Using this line : cpe1.TargetControlID = mycontrol.StepPanel.ID
Give this error:
Exception Details: System.InvalidOperationException: The TargetControlID of 'myCollapsiblePanelExtender' is not valid. A control with ID 'ContentPanelStep' could not be found.
Using this line: cpe1.TargetControlID = Page.FindControl(myControl.ID).ID;
Give me this error:
Exception Details: System.InvalidOperationException: Extender control 'myCollapsiblePanelExtender' cannot extend 'MyControl1'. Extender controls of type 'AjaxControlToolkit.CollapsiblePanelExtender' cannot extend controls of type 'ASP.controls_exampletry_ascx'.
eddyperu1
Member
6 Points
17 Posts
Re: Why my collapsible Panel doesn't read the ClientID from my web User Control?
Nov 07, 2008 03:44 PM|LINK
Using this line : cpe1.TargetControlID = mycontrol.StepPanel.ID
Give this error:
Exception Details: System.InvalidOperationException: The TargetControlID of 'myCollapsiblePanelExtender' is not valid. A control with ID 'ContentPanelStep' could not be found.
Using this line: cpe1.TargetControlID = Page.FindControl(myControl.ID).ID;
Give me this error:
Exception Details: System.InvalidOperationException: Extender control 'myCollapsiblePanelExtender' cannot extend 'MyControl1'. Extender controls of type 'AjaxControlToolkit.CollapsiblePanelExtender' cannot extend controls of type 'ASP.controls_exampletry_ascx'.
The code:
protected void Page_Init(object sender, EventArgs e){
controls_Exampletry myControl = (controls_Exampletry)Page.LoadControl("controls/Exampletry.ascx");myControl.ID = "MyControl1";Page.Controls.Add(myControl);
AjaxControlToolkit.
CollapsiblePanelExtender cpe1 = new AjaxControlToolkit.CollapsiblePanelExtender(); cpe1.ID = "myCollapsiblePanelExtender"; //cpe1.TargetControlID = Page.FindControl(myControl.ID).ID;cpe1.TargetControlID = myControl.StepPanel.ID;
Page.Controls.Add(cpe1);
HtmlTableRow stepRow = new HtmlTableRow();HtmlTableCell stepCell = new HtmlTableCell();stepCell.Controls.Add(myControl);
stepCell.Controls.Add(cpe1);
stepRow.Cells.Add(stepCell);
StepsTable.Rows.Add(stepRow);
}