On page editing of properties in MVC works so that when a property value has been updated a request is made to PropertyRender Controller (you can see this request from browser if you open up developer tools). That controller will then basically render a view which does @Html.PropertyFor(theProperty). So in your case will it call the PropertyRender Controller that it should render property 'Callout' (since that is what you specify in EditAttributes). So you need to have a partial template for Callout (that basically could call render CalloutContent) that can be used during editing.
This is not how on-page-edit works. I would recommend you to change your code to something like this:
@Html.PropertyFor(m => m.CurrentBlock.Callout)
Then create a view called Callout in /views/shared/blocks/Callout.cshtml. And in this view you put:
@model Callout <p> @Model.CalloutContent<br /> </p>
If you already have a view for the block, then you can use a tag and create a view for that tag instead:
@Html.PropertyFor(m => m.CurrentBlock.Callout, new { Tag = "MyTag" })
And name the view MyTag instead /views/shared/displaytemplates/MyTag.cshtml
Hi all,
I got a block called Callout, it's not used as a regular block. It's used as a composite property (AvailableInEditMode=false) on another block. It has some properties and one of them is "CalloutContent"
In my view I display only CalloutContent but i using Html.EditAttributes so it's easy for update all other properties of block Callout
I go to edit mode and click the callout content area to edit my properties, but after leave the edit property form, my view show "Callout can't be displayed"
I have thought that the view should be updated and i can see my new CalloutContent
Anyone know what is wrong?