Sitefinity ASP.NET CMS - Content Management System

Support Forum Thread

Home >  Support >  Forums home > Sitefinity 3.x > Pre-release forums (retired) > MS AJAX Compatibility

Reply
Jason Grovert, 4/19/2007 6:56:53 PM
We have designed several User Controls (.ascx) using the new AJAX Extentions for ASP.Net from Microsoft and have encountered a problem when editing a page.  If there's a control on the Page that contains an UpdatePanel and you drop any other control on the page you get an Exception.  The ScriptManager control is on the MasterPage for the Template we are using for this page.  You can easily reproduce this my creating a User Control and dropping an UpdatePanel control on it.  Then add the control to a page.  Next add any additional control to the page and you'll get the error.  This is a serious problem because it prevents us from adding User Controls that contain UpdatePanels to a page, or at best it must be added last.


Reply
, 4/20/2007 3:35:13 AM
Hi Jason,

Thank you very much for turning our attention to this issue. We agree that support for MS Ajax is important issue and we will fix it for the official release of Sitefinity 3.0.

Kind regards,
Bogdana Ivanova
the telerik team

Instantly find answers to your questions at the new telerik Support Center

Reply
, 5/9/2007 4:08:59 AM
Hi Jason Grovert,

I was able to test the scenario you are describing with AJAX Extentions for ASP.Net but was not able to reproduce any exceptions. I did the following:

1. Created User Control with UpdatePanel on it.
2. Added Script Manager to the master page.
3. Updated my web.config.
4. Added the control to the page and some other control to the page without any errors.

Can you let me know what exception you get and if there is some inconsistency in my and your steps with using ajax user controls. Perhaps it would be much easier if you could send us some basic project which rises the problem. Thanks in advance. I am looking forward for your reply.

All the best,
Vassil Daskalov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center

Reply
Jason Grovert, 6/1/2007 11:35:47 AM
What do you mean by "Updated my web.config"?  We can reproduce the error every time. (see below)

Server Error in '/' Application.  
--------------------------------------------------------------------------------  
 
Cannot unregister UpdatePanel with ID 'TitleEscrowPanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.  
Parameter name: updatePanel   
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.ArgumentException: Cannot unregister UpdatePanel with ID 'TitleEscrowPanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.  
Parameter name: updatePanel  
 
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:   
 
 
[ArgumentException: Cannot unregister UpdatePanel with ID 'TitleEscrowPanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.  
Parameter name: updatePanel]  
   System.Web.UI.PageRequestManager.UnregisterUpdatePanel(UpdatePanel updatePanel) +216  
   System.Web.UI.ScriptManager.System.Web.UI.IScriptManagerInternal.UnregisterUpdatePanel(UpdatePanel updatePanel) +67  
   System.Web.UI.UpdatePanel.OnUnload(EventArgs e) +71  
   System.Web.UI.Control.UnloadRecursive(Boolean dispose) +267  
   System.Web.UI.Control.UnloadRecursive(Boolean dispose) +204  
   System.Web.UI.Control.RemovedControl(Control control) +89  
   System.Web.UI.ControlCollection.RemoveAt(Int32 index) +96  
   System.Web.UI.ControlCollection.Remove(Control value) +22  
   Telerik.Cms.Web.UI.ControlDesigner.RenderControl() +438  
   Telerik.Cms.Web.UI.ControlDesigner.CreateChildControls() +950  
   System.Web.UI.Control.EnsureChildControls() +87  
   System.Web.UI.Control.PreRenderRecursiveInternal() +41  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Control.PreRenderRecursiveInternal() +161  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360  
 
   
 
 
--------------------------------------------------------------------------------  
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210  

Reply
, 6/4/2007 5:32:38 AM
Hello Jason,

I was able to reproduce your error this time. Sorry for misleading you. Perhaps I tested with an older version. Anyway the problem is already localized and we will give it a closer look. Unfortunately, we cannot give you a quick workaround for it but you could add your control last to the page when you are sure you have finished with the page layout.

Once again I am sorry and thanks for the valuable feedback. Your Telerik points have been updated.

Best wishes,
Vassil Daskalov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center

Reply
Leonard Simmons, 10/29/2007 10:53:02 AM
Has there been any resolution to this? We have the same problem and it makes sitefinity unusable.

ta

Len

Reply
, 10/30/2007 10:43:49 AM
Hi Leonard,

The fix of this issue will be included in the upcoming Service Pack that is coming out at the end of the month. Please contact us if the problem persists after upgrading your project to SP.

Kind regards,
Pepi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center

Reply
Sipke, 12/7/2007 5:49:08 AM
I applied the SP2 patch, but I still get an exception when I have an UpdatePanel in a MasterPage and try to edit the masterpage, or a page using the masterpage.

To reproduce the problem, do the following:

1. Create a masterpage with both a ScriptManager and an UpdatePanel, and upload it in SiteFinity to generate a Template.
2. Try to edit the template. You will get an exception, stating that you "Cannot unregister UpdatePanel with ID 'myUpdatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameternaam: updatePanel
"

I will try using the RadAjax control and see what happens.

Best regards,
Sipke

Reply
Sipke, 12/7/2007 6:10:24 AM
Using RadAjax solved my problem in this case...
Reply
senzani, 2/4/2008 11:49:32 AM
Is there a resolution to using the UpdatePanel? Is this still being addressed?
Reply
, 2/5/2008 8:19:11 AM
Hello Sipke and Steve,

Thanks a lot for pointing out this issue. It seems that the problem has been fixed for User Controls only, i.e. when you use UpdatePanels in a User Control. For the time being, the workaround is to avoid using UpdatePanels in the master pages.
You could separate the functionality that should be updated without refreshing the whole page in a User Control and wrap the specific regions inside UpdatePanels.

Your Telerik accounts have been updated for noticing this.

Kind regards,
Pepi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center

Reply
Chris, 8/26/2008 4:43:33 PM
Hi Sipke, I was wondering if you could help? 

I have been having similar issues with getting update panels to work in Sitefinity.
You mentioned that:

"Using RadAjax solved my problem in this case..."

Can I ask how you achieved this?  I tried switching to the RadAjax and got same issues.

e.g. when dragging a generic content control into a page I get...

Cannot unregister UpdatePanel with ID 'des4$ctl06$RadAjaxPanel1Panel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.Parameter name: updatePanel

Thanks for any advice you can give

Chris

Reply
Chris, 8/27/2008 4:02:04 AM

Hi Everyone,
After some experimentation I have come up with an alternative solution to using Ajax Update panels in Sitefinity. It might not be ideal for everyone but I thought it might be worth sharing.

First I created my UserControl with Ajax Update Panel functionality in the standard way.

Then I created a second UserControl to upload to Sitefinity. This control has nothing but a single PlaceHolder control in the ascx. In the code behind I added the following...

string pageMode = base.Request.QueryString["cmspagemode"];

if (!string.IsNullOrEmpty(pageMode) && (pageMode == "edit" || pageMode == "preview"))
{
// we are in Sitefinity's backend
// you could load in a message or dummy control

}
else
{

Control QuickSearchUserControl = LoadControl("~/UserControls/Custom/QuickSearchFrontend.ascx");
ControlPlaceHolder.Controls.Add(QuickSearchUserControl);
}

Basically it detects if you are in the Sitefinity backend using the QueryString "cmspagemode". If we are in the backend don't load the control with the Ajax Update Panel (as it causes issues when editing in sitefinity). If we aren’t load the control as normal.

This could easily be extended into a control with a property for the path to the UserControl to load in and maybe a second property for a message to show in when in the backend of Sitefinity. That way it could be reused across a Sitefinity Site and the path / message properties could be set in the Sitefinity UI.

Hope this is of some use to you

Thanks

Chris



Reply
, 8/27/2008 11:18:53 AM
Hello Chris,

I think this will be definitely helpful for someone - we will redirect him to this solution. Thank you for sharing it with the community. We have updated your Telerik account for that.

Regards,
Georgi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Reply
Mark, 11/1/2008 4:53:46 AM
It certainly helped me!

Thanks Chris

Mark