Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Get the user defined proprty count

Vote:
 

How can I get the number of user defined properties for a page?

CurrentPage.Property.Count gives the count of all inbuilt as well as user defined properties, but I want only those porperties tha the user has made.

 Thanks in advance

#22687
Aug 12, 2008 12:50
Vote:
 

Hi!

I think you would need to do something like this:

int count = 0;

foreach (PropertyData prop in CurrentPage.Property)
{
  if (prop.IsPropertyData)
  {
    count++;
  }
}

Regards

Per Gunsarfs
EPiServer CMS Development Team

#22690
Aug 12, 2008 13:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.