RadEditor from ContentBlock inside a Custom Control

Posted by Community Admin on 03-Aug-2018 17:50

RadEditor from ContentBlock inside a Custom Control

All Replies

Posted by Community Admin on 03-Sep-2010 00:00

Greetings,


Is there a way of include the exact same functionality that the RadEditor inside the Sitefinity's Content Block Control Designer has inside a Custom Control Designer?

Basically I've added a RadEditor into one of my Custom Control Designers, with the exact tools that the Content Block one has, loaded from an XML file, however when attempting to use the HyperLink Manager option or right clicking on a link on the content area or on an image there as well and choosing Properties causes a window with an error to appear saying that the Telerik's Dialogs require a handler to process them and that it should be added to the web.config.

Server Error in '/WebSite' Application.

The type DialogBase does not have an accessible constructor.

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 type DialogBase does not have an accessible constructor.

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 type DialogBase does not have an accessible constructor.]
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForNullExistingObject(IBuilderContext context) +234
   BuildUp_Telerik.Sitefinity.Web.UI.DialogBase(IBuilderContext ) +138
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +341
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +131

[BuildFailedException: The current build operation (build key Build Key[Telerik.Sitefinity.Web.UI.DialogBase, Telerik.Web.UI.DialogHandler.aspx]) failed: The type DialogBase does not have an accessible constructor. (Strategy type BuildPlanStrategy, index 5)]
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +474
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing) +137
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name) +211

[ResolutionFailedException: Resolution of the dependency failed, type = "Telerik.Sitefinity.Web.UI.DialogBase", name = "Telerik.Web.UI.DialogHandler.aspx". Exception message is: The current build operation (build key Build Key[Telerik.Sitefinity.Web.UI.DialogBase, Telerik.Web.UI.DialogHandler.aspx]) failed: The type DialogBase does not have an accessible constructor. (Strategy type BuildPlanStrategy, index 5)]
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name) +329
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.Unity.UnityContainer.Resolve(Type t, String name) +15
   Telerik.Sitefinity.Utilities.Microsoft.EnterpriseLibrary.Unity.UnityContainerBase.Resolve(String name) +55
   Telerik.Sitefinity.Web.DialogRouteHandler.InitializeContent(Page handler, RequestContext requestContext) +109
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


The handler exists on the web.config and the Content Block RadEditor dialogs are working correctly there.

So, basically I'm trying to use the exact functionality you've created there but while using it inside of a Custom Control Designer which has some other controls attached to it. Is there a way to achieve this? And if so, how?

Thanks in advance,

Daniel

Posted by Community Admin on 07-Sep-2010 00:00

Hello Daniel,

Add the following property to RadEditor control that you have declared in your template 
DialogHandlerUrl ="~/Telerik.Web.UI.DialogHandler.axd"

sample

<telerik:RadEditor
runat="server"
ID="RadEditor1"
ToolsFile="~/Controls/EditorToolsFile.xml"                  
Skin="WebBlue"                    
NewLineBr="False"
Width="95%"
DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
ContentFilters="EncodeScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent">
</telerik:RadEditor>




Greetings,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Sep-2010 00:00

Greetings,


That solved my issue while using my custom RadEditors, thank you very much. There is still a small error which appears though when using the option "Table Wizard" present on the button "Insert Table", the same error also occurs when using the RadEditor on a normal page as well.

Server Error in '/WebSite' Application.

Could not find the specified key "TableWizard_SelectAll" or class id "RadEditor.Dialogs".

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: Could not find the specified key "TableWizard_SelectAll" or class id "RadEditor.Dialogs".

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: Could not find the specified key "TableWizard_SelectAll" or class id "RadEditor.Dialogs".]
   Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, String key, CultureInfo culture, Boolean falback, Boolean throws) +504
   Telerik.Sitefinity.Localization.Res.Get(String classId, String key, CultureInfo culture, Boolean fallback, Boolean throws) +245
   Telerik.Sitefinity.Localization.GlobalResourceProvider.GetObject(String resourceKey, CultureInfo culture) +64
   System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +32
   System.Web.HttpContext.GetGlobalResourceObject(String classKey, String resourceKey, CultureInfo culture) +43
   Telerik.Web.GlobalResourceLocator.GetString(String resourceKey) +49
   Telerik.Web.LocalizationStrings.GetString(String key) +102
   Telerik.Web.UI.Editor.DialogControls.DialogLocalizationStrings.InitializeDialogStrings() +174
   Telerik.Web.UI.Dialogs.UserControlBase.UpdateChildControls(Control currentControl) +904
   System.Web.UI.Control.EnsureChildControls() +146
   Telerik.Web.UI.Dialogs.UserControlBase.OnInit(EventArgs e) +28
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +271
   Telerik.Web.UI.DialogHandlerNoSession.AddDialogControl(Control dialogControl, DialogParameters dialogParameters) +480
   Telerik.Web.UI.DialogHandlerNoSession.LoadDialogControl() +709
   Telerik.Web.UI.DialogHandlerNoSession.CreateChildControls() +200
   System.Web.UI.Control.EnsureChildControls() +146
   Telerik.Web.UI.DialogHandlerNoSession.OnPreLoad(EventArgs e) +24
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2252


Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927

Is there any workarounds for this?

The dialogs open correctly now but they still appear with the Title and the Close button and they are still moveable, is there a way to prevent this? I still haven't checked it and will do so after lunch since there may be an easy option to activate for this funcionality.

Also, despite specified the DialogHandlerUrl in order to solve the issue is there any way to reproduce the exact same functionality that the one from the Content Block has? This one when inserting an hyperlink gives you the option to also choose a Page to use and inserting an image also gives you an option to choose an image from the albums. Basically I would like to use the RadEditor with these custom dialogs on my custom controls since they are quite handy.

Thanks in advance.

Daniel

Posted by Community Admin on 08-Sep-2010 00:00

Hi Daniel,

This is a bug that I have logged in. It appears with the ContentBlock control as well. I updated your Telerik points.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed