SaaS CMS has officially launched! Learn more now.

Issues with contentarea and viewdata gets dropped when moving the blocks in the ui


Hi there iam currently having issues with the viewdata dropping and the AlloyContentAreaRenderer isnt providing with the neccecary classes.

is there anyone else that had this issue?

protected override string GetContentAreaItemCssClass(HtmlHelper htmlHelper, ContentAreaItem contentAreaItem)
var baseItemCssClass = base.GetContentAreaItemCssClass(htmlHelper, contentAreaItem);
var tag = GetContentAreaItemTemplateTag(htmlHelper, contentAreaItem);

return string.Format("{0} {1} {2} {3}", GetTypeSpecificCssClasses(contentAreaItem), GetCssClassForTag(tag), tag, baseItemCssClass);


the first load i get span4 on the block and its container gets row-fluid

second request(when iam moving the block within the content area) the classes will be empty

Aug 09, 2016 10:05

You will get an empty string if you've set the block to automatic but other than that the correct size should come through if you've set wide, narrow or full. We are using this in EPiServer 9 without issues

Aug 09, 2016 13:05

yeah currently using episerver 9 thou upgraded from 7, and i booted up the alloy site and the samething works fine there, i dont know if its because they use the tag system to build upp diffrent classes.

this is how i render the contentarea


 @Html.PropertyFor(x => x.ContentArea, new { CssClass = "row-fluid", ChildrenCssClass = "span4" })

CssClass is what the wrapper will have and the ChildrenCssClass is what each block(contentareaitem) will have.

so iam not using the DiplayOption that most user use. maybe thats why the viewdata becomes empty since there is no refrence beside the view, and when you move with episerver there is a ajax request for updating the view, so then i wont be able to find the view data provided  with the ChildrenCssClass...

Aug 09, 2016 14:12

well i found the issue, the issue was that the contentarea was renderd in a custom way and by that you have to add 

@Html.FullRefreshPropertiesMetaData(new [] { "<PropertyName>"})

to force episerver to do a full refresh of the page when the block are moved, was looking on the wrong property.

thanks for your efforts to help me =)


Edited, Aug 10, 2016 7:54

Ah yes you need that to refresh, although I personally prefer rendering 


On your master page and then connecting the properties that need refresh in your controllers. As defined here

var editingHints = ViewData.GetEditHints<EditSampleViewModel, EditSamplePage>();

editingHints.AddFullRefreshFor(p => p.ShowBanner);
Edited, Aug 10, 2016 9:35
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.