This is a migrated thread and some comments may be shown as answers.

RadDock and CollapsiblePanelExtender

3 Answers 103 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 06 Aug 2008, 06:58 PM
I have a CollapsiblePanelExtender inside of a RadDock object. It's not work properly, meaning a post-back is triggered when clicking CollapseControl/ExpandControl.
See the code behind below:

CollapsiblePanelExtender _cpeAdvanced = new CollapsiblePanelExtender(); 
_cpeAdvanced.TargetControlID = pnlAdvanced.ID; 
_cpeAdvanced.ExpandControlID = _cpeAdvanced.CollapseControlID = btnAdvanced.ID; 
_cpeAdvanced.AutoCollapse = _cpeAdvanced.AutoExpand = false
_cpeAdvanced.Collapsed = true
Controls.Add(_cpeAdvanced); 

where:
  • pnlAdvanced is an asp.net panel;
  • btnAdvanced is an asp.net button;
Any help will be appreciate!
10x!

3 Answers, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 07 Aug 2008, 03:48 PM
Hello Dan,

Please, try to place the CollapsiblePanelExtender directly on the page instead of inside the RadDock control and test whether you will reproduce the same issue. The asp button is a control which causes a postback when clicked which is most probably the reason for the issue you observe. I would also like to ask you let us know where you place the code snippet you have sent us. As far as I see you add the CollapsiblePanelExtender  inside a controls collection. Which is this controls collection? You mention that you add the CollapsiblePanelExtender in a dock control. How do you do this? Please, send us some more code snippets giving a better idea of your setup. We will be glad to help you.

Kind regards,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 07 Aug 2008, 08:35 PM
Sorry!
Controls collection belongs to an user control which is loaded at runtime in a RadDock control.
I've tried to place Extender directly on Page control or Page.Form, but this exception is raised:

 The TargetControlID of '' is not valid. A control with ID 'pnlAdvanced' could not be found. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.InvalidOperationException: The TargetControlID of '' is not valid. A control with ID 'pnlAdvanced' could not be found. 
 
Source Error: 
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace: 
 
[InvalidOperationException: The TargetControlID of '' is not valid. A control with ID 'pnlAdvanced' could not be found.] 
   System.Web.UI.ExtenderControl.RegisterWithScriptManager() +311731 
   System.Web.UI.ExtenderControl.OnPreRender(EventArgs e) +19 
   AjaxControlToolkit.ExtenderControlBase.OnPreRender(EventArgs e) in d:\E\AjaxTk-AjaxControlToolkit\Orcas\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:367 
   System.Web.UI.Control.PreRenderRecursiveInternal() +80 
   System.Web.UI.Control.PreRenderRecursiveInternal() +171 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 
 

In this moment I've no inspiration to solve the problem...
If I comment AjaxSettings everything goes fine.
Hope this helps.
Dan
0
Sophy
Telerik team
answered on 11 Aug 2008, 07:13 AM
Hi Dan,

We tested adding a UserControl containing a CollapsiblePanelExtender control in a RadDock using the configuration you describe and could not find any difference if the UserControl containing a CollapsiblePanelExtender control is placed inside or outside the dock. As I mentioned in my previous reply if you use an asp button for btnAdvanced and it is not ajaxified it will cause a postback when clicked no matter whether the CollapsiblePanelExtender control is inside or outside a RadDock. I suggest you try to replace the asp button with an html input type button element and test the same scenario:
<input type="button" id="btnAdvanced" runat="server" value="expand/collapse" />
No postback should occur in this case.
We need more details about your scenario in order to help you. You mention that you have AjaxSettings added. Which controls do you ajaxify? Please, make sure that you have a CollapsiblePanelExtender working as expected outside the RadDock control and let us know in case you experience different behavior when the CollapsiblePanelExtender is inside the RadDock. I would also like to ask you send us some code snippets demonstrating your exact setup so that we can take a closer look at your configuration and test it on our side.

All the best,
Sophy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
Michael
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Michael
Top achievements
Rank 1
Share this question
or