November Happy Hour will be moved to Thursday December 5th.

Programmatically set block expiration datetime

Vote:
 

I cannot find any property for a block in code which corresponds to Expire Date property in CMS. As far as I can see, Episerver.Core.PageData has a property StopPublish, which, as far as I know, corresponds to expiration date in CMS. But Episerver.Core.BlockData has no such property.

Is it not possible to set the expiration date for a block?

#178046
Apr 27, 2017 16:16
Vote:
 

You'll have to cast it to IVersionable first - (currentBlock as IVersionable).StopPublish

#178054
Apr 28, 2017 7:54
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.