开发者

Umbraco - How can I get Publish at/Remove at date using C#

开发者 https://www.devze.com 2023-04-05 03:20 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消