Check if property exists Options
nikolas
Posted: Thursday, October 02, 2008 2:20:50 PM

Rank: Devotee

Joined: 1/17/2007
Posts: 67
Location: Bergen, Norway
Are there an easy way to check if a property exists for a specific Document Type?

Something like:

Code:
if (d.getProperty(propertyAlias).Exists)
  d.getProperty(propertyAlias).Value = myValue;

Dirk
Posted: Thursday, October 02, 2008 3:01:49 PM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,123
Location: Belgium
Hi nikolas,

Check for null value as getProperty(alias) returns null if no property is found.

Hope that helps.

Regards,
/Dirk


level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
nikolas
Posted: Thursday, October 02, 2008 3:40:36 PM

Rank: Devotee

Joined: 1/17/2007
Posts: 67
Location: Bergen, Norway
Thanks! ;)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.