Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Getting last modified date thru CMSContext View modes: 
User avatar
Member
Member
jp.principio.mail-gmail - 9/29/2011 3:13:21 AM
   
Getting last modified date thru CMSContext
Hi,

Can I get the LastModifiedDate field thru CMShelper or cmscontext?

Thanks,

JP

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/30/2011 2:44:45 AM
   
RE:Getting last modified date thru CMSContext
Hi,

Unfortunately this property is not included into the CMSContext. Anyway, you can access it easily for current node object or document using GetValue("DocumentModifiedWhen");

Best regards,
Juraj Ondrus

User avatar
Member
Member
andry.poernomo-alyka.com - 6/19/2012 3:59:17 AM
   
RE:Getting last modified date thru CMSContext
Hi Juraj,

Could you please give us a sample code?

Cheers,

Andry

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/19/2012 6:54:11 PM
   
RE:Getting last modified date thru CMSContext
Hi,

You can find many samples in our API examples.

The code for you, in this sample for document with current alias path

TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
TreeNode node = tree.SelectSingleNode(CMSContext.CurrentSiteName, CMSContext.CurrentAliasPath, "en-us");
string modDate= node.GetValue("DocumentModifiedWhen").ToString();


Best regards,
Juraj Ondrus