Composer ExtensionContentArea renders empty DIV



In our Composer Layout blocks we've noticed that Extension:ExtensionContentArea renders an empty DIV as its end-tag:

<!-- Start Composer Layout block -->

<!-- Start Composer Content block -->

Content goes here

<!-- End Composer Content block -->

<div> </div>

<!-- End Composer Layout block -->


Has anyone else experienced this, and if so, how can it be avoided?



May 22, 2012 8:52

Hi Marcus,

I've also experienced this but I'm sorry to say that i don't know any solution for it. I am also looking for a solution so if you managed to find anything let me know.

Jul 25, 2012 14:58

Hi Thomas,

The solution we came up with (or rather "quick-fix") was to use jQuery to remove the empty DIV-tag.

Jul 30, 2012 9:02

Hmmm, using javascript doesn't really cut it for me. Tried to solve it using inheritance and overrides on the render methods but without success. Anybody found a solution yet?

Sep 25, 2012 16:41

Hi, I realise this thread is very old, but did anyone ever find a solution or workaround (non-Javascript based) to resolve this?

Sep 10, 2014 2:58

I think I've found both the solution and the cause...

It's possibly being caused by the holder panel in the ExtensionContentArea control rendering when in non-edit mode. This could be resolved by EPiServer using a PlaceHolder instead of a Panel.

To fix it, you can attach the following pre-render handler to your ExtensionContentArea's which will hide the holder panel in non-edit mode.

        private static Lazy HolderGetter = new Lazy(() =>
            var type = typeof(ExtensionContentArea);
            var field = type.GetMember("_holder", MemberTypes.Field, BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Instance).FirstOrDefault() as FieldInfo;
            return field;

        internal static void ExtensionArea_PreRender(object sender, EventArgs e)
            var extensionArea = sender as ExtensionContentArea;
            if (extensionArea != null && HolderGetter.Value != null)
                var holder = HolderGetter.Value.GetValue(extensionArea) as Control;
                if (holder != null && extensionArea.Holder != holder)
                    holder.Visible = false;

If you're particularly tricky, you may be able to attach it to your page's ExtensionPageHandler's LoadContentArea event to make sure you get your pre-render handler onto them all...

Edited, Sep 10, 2014 9:02
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.