开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜