AI OnAI Off
Are you using the block as a shared block, or as a property on a page? If it is a property of a page, you cannot convert it to an IContent as it will just be a set of properties.
The cast will be not null when the block instance is a shared block. When it is a block property instance (for example a block property on a page) then it will be null. It is only shared block instances that implement IContent. See more :http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2012/11/Shared-blocks--IContent/
I have a block called XFormBlock. The default controller/action is this.
}
Now I want to cast the currentBlock to IContent but when doing so I get null. IContent iContent = (currentBlock as IContent);
XFormBlock inherits from BlockData so why can't I do this?
Thanks!