Dynamic content and propertyimageurl

Vote:
 

When I add a Dynamic Content control to an instance of a page that isn't saved yet and the Dynamic Content controls contains a "PropertyImageUrl" I get the following error:


Note When an instance of the page exists it works fine. This only started appearing after upgrading the site from 5.2 to 6.0.


Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.

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:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Editor.HtmlEditor.GetFileManagerBrowserUrl(PageReference id, PageReference parent, Int32 folderid) +127
   EPiServer.Web.PropertyControls.PropertyUrlControl.CreateLinkEditorScript() +249
   EPiServer.Web.PropertyControls.PropertyUrlControl.SetupEditControls() +811
   EPiServer.Web.PropertyControls.PropertyTextBoxControlBase.CreateEditControls() +252
   System.Web.UI.Control.EnsureChildControls() +145
   EPiServer.Web.PropertyControls.PropertyDataControl.SetupControl() +12
   EPiServer.Web.PropertyControls.PropertyUrlControl.SetupControl() +156
   EPiServer.UI.WebControls.PropertyDataForm.SetupPropertyControls(Control control) +185
   EPiServer.UI.WebControls.PropertyDataForm.SetupPropertyControls(Control control) +200
   EPiServer.UI.WebControls.PropertyDataForm.SetupPropertyControls(Control control) +200
   EPiServer.UI.WebControls.PropertyDataForm.SetupPropertyControls(Control control) +200
   EPiServer.UI.WebControls.PropertyDataForm.CreateChildControls() +1489
   System.Web.UI.Control.EnsureChildControls() +145
   System.Web.UI.Control.PreRenderRecursiveInternal() +60
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Control.PreRenderRecursiveInternal() +223
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3393

 

#43623
Sep 20, 2010 17:00
Vote:
 

I have the same error. I'm guessing there's a bug in CMS/Editor/Dialogs/DynamicContent.aspx regarding the PageReference parameters.

#44074
Sep 30, 2010 10:25
Vote:
 

The problem I think is that the dynamic content edit page don't have any reference to which page you are on. Therefor the error

I think this fix it

http://labs.episerver.com/en/Blogs/Anders-Hattestad/Dates/2009/8/Properties-in-Dynamic-Content-donrsquot-know-what-CurrentPage-is/

#44076
Sep 30, 2010 10:39
Vote:
 

Thanks Anders!

I needed to change the this.Page.Request["id"] == null condition to string.IsNullOrEmpty(this.Page.Request["id"]) to make it work in my case though.

 

 

#44080
Sep 30, 2010 11:04
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.