Umbraco - How can I get Publish at/Remove at date using C#
How can I get Publish at/Remov开发者_开发百科e at date using C# in Umbraco?
You just need to access the ReleaseDate and ExpireDate of the Document object.
var doc = new Document(nodeId);
var publishAt = doc.ReleaseDate;
var removeAt = doc.ExpireDate;
Your post helped me a lot. Thank you! I'm a novice on Umbraco, and I have a little comment. To get it to work we need to import the businesslogic namespace:
@using umbraco.cms.businesslogic.web;
It would be obvious for experienced users, but can be useful to novices like me.
精彩评论