Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Anything similar to EditContainerClass using ASP.NET Forms?


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?

Oct 25, 2013 11:42

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.

Oct 25, 2013 14:17

Didn't know about the RenderSetting, seem to be exactly what I'm looking for.

Thanks Eric! :)

Edited, Oct 31, 2013 13:08

I had the same question.  I do not see EditContainerClass as a property of the RenderSetting web control.  Am I missing something?

Nov 13, 2013 16:22

Did you find a solution for this? I cant get the rendersettings-tip to work.

Mar 25, 2014 15:11

No, we have unfortunately not been able to get this to work :(

Mar 25, 2014 15:37

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 webcontrol you can set that from code behind

heading.ApplyEditAttributes<ImageGalleryBlockType>(p => p.Heading);


Mar 25, 2014 15:48

I fixed it by declaring a property such as this:

<EPiServer:Property runat="server" PropertyName="MainBody">
   <RenderSettings EditContainerClass="overflow-hidden" />

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 () {


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.

Edited, Mar 26, 2014 8:51
<EPiServer:Property runat="server" PropertyName="MyContentArea" >
            <RenderSettings ChildrenCssClass="overflow-hidden" />


This seems to work

Edited, Apr 11, 2014 9:46
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.