Welcome Guest
Search
Active Topics
Log In
Register
umbraco Forum
»
.NET and umbraco
»
Using own controls with umbraco
»
Check if property exists
Check if property exists
Options
Previous Topic
·
Next Topic
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;
Back to top
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
Back to top
nikolas
Posted:
Thursday, October 02, 2008 3:40:36 PM
Rank: Devotee
Joined: 1/17/2007
Posts: 67
Location: Bergen, Norway
Thanks! ;)
Back to top
Users browsing this topic
Guest
umbraco Forum
»
.NET and umbraco
»
Using own controls with umbraco
»
Check if property exists
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.
Watch this topic
RSS Feed
Email this topic
Print this topic
Threaded
Normal
XHTML
CSS
© 2001-2008 Umbraco. Forum based on YetAnotherForum.net.