Try our conversational search powered by Generative AI!

Programmatically set block expiration datetime


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?

Apr 27, 2017 16:16

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

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.