ASPX templates
Version 4.x > ASPX templates > how can I get the DocID from TreeNode? View modes: 
User avatar
Member
Member
hotfrost-gmail - 12/27/2009 11:54:30 PM
   
how can I get the DocID from TreeNode?
where I can get the classID from the node:

CMS.SettingsProvider.DataClassInfoProvider.GetDataClass(ValidationHelper.GetInteger(dr["NodeClassID"], 0));

how can i get the docID from the node?

help is appreciated.

Al

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 12/30/2009 4:46:31 AM
   
RE:how can I get the DocID from TreeNode?
Hello,

You can use following API code to get current NodeClassId:

CMS.CMSHelper.CMSContext.CurrentPageInfo.NodeClassId

Or you can obtain class ID from tree node like this:

node.GetValue("NodeClassID")

Best regards
Ondrej Vasil

User avatar
Member
Member
hotfrost-gmail - 12/30/2009 1:41:27 PM
   
RE:how can I get the DocID from TreeNode?
Ondrej,

I can get the classID no problem, I am talking about DocID from CMS_Documents table..

How Can I get that knowing the Node? There is AliasPath, should I compare them Doc and Node? Or there are some other API calls exist that will allow me find out what doc ID the node represents?

thanks,

Alex

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 12/31/2009 12:58:55 AM
   
RE:how can I get the DocID from TreeNode?
Hello,

whether you would like to get DocumentID for particular known node, you can do it like this:

node.DocumentID

Best regards
Ondrej Vasil