Not sure exacty what you are after but you could use the webcontrol <episerver:property><rendersetting../></episerver:property> you could also set an id to a control like <asp:label> or <asp:image> and set the ApplyEditAttributes from code behind.
Didn't know about the RenderSetting, seem to be exactly what I'm looking for.
Thanks Eric! :)
I had the same question. I do not see EditContainerClass as a property of the RenderSetting web control. Am I missing something?
Did you find a solution for this? I cant get the rendersettings-tip to work.
Does not seem to be any EditContainerClass in the webcontrol but that should most of the times be renderd by the control it self. If you have a asp.net webcontrol you can set that from code behind
heading.ApplyEditAttributes<ImageGalleryBlockType>(p => p.Heading);
I fixed it by declaring a property such as this:
<EPiServer:Property runat="server" PropertyName="MainBody">
<RenderSettings EditContainerClass="overflow-hidden" />
</EPiServer:Property>
And then using jquery to set the class for the property in edit mode, such as this:
<script type="text/javascript">
$("[data-epi-property-rendersettings]").each(function () {
$(this).addClass($(this).data('epi-property-rendersettings').editContainerClass);
});
</script>
The javascript simply loops through all elements in the DOM that has the data-epi-property-rendersettings attribute and sets the class accordingly. Too bad this is not supported by EPiServer though. Using reflector on the source code it looks like EditContainerClass is only for MVC.
<EPiServer:Property runat="server" PropertyName="MyContentArea" >
<RenderSettings ChildrenCssClass="overflow-hidden" />
</EPiServer:Property>
This seems to work
Is there any way to set styles on the editor control similar to what EditContainerClass does under MVC in a ASp.NET Forms based EPiServer 7 site?