Hi!
Just by browsing the code quickly I see that we internally handle dynamic content as the interface IDynamicContentBase. I don't know if it's a requirement that the dynamic content implement this but try implementing this or inherit from the base class (DynamicContentBase) and see if this fixes the issue.
Regards
Linus Ekström
EPiServer Development Team
I ended up with
[DynamicContentPlugIn(
DisplayName = "Name",
Url = "EditControl.ascx" )]
public class MyClass : IDynamicContent, IDynamicContentDisplayType
{
/* Code */
}
using State and Render() for the output. I was hoping it would be possible to keep two user controls like I had in the start but I didn't manage to get RenderAsBlockElement to work before I made it into a regular class.
I've made a dynamic content control using the DynamicContentPlugIn attribute. I have one control for edit as well as the control used for rendering the content. It works well as long as all I want is for the dynamic content placeholder to render as a block element in the editor, but it won't render inline. I've tried to implement IDynamicContentDisplayType in both my controls but RenderAsBlockElement is never called in either of them. Is there something I'm missing?
[DynamicContentPlugIn(
DisplayName = "Name",
Url = "EditControl.ascx",
ViewUrl = "Control.ascx")]
public partial class MyClass: UserControl, IDynamicContentDisplayType
{
/*Code here*/
public bool RenderAsBlockElement { get { return false; } }
}
public partial class MyClassEdit : DynamicContentEditControl, IDynamicContentDisplayType
{
public override void PrepareForSave()
{
Content.Properties[ "SelectedValue" ].Value = SelectedValue;
}
public bool RenderAsBlockElement { get { return false; } }
}