London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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!