How to get properties with c# Options
mels
Posted: Friday, January 04, 2008 3:41:29 PM
Rank: Newbie

Joined: 1/4/2008
Posts: 2
Hi all.

I'm trying to get the value of a generic property using the following code:

Code:

umbraco.cms.businesslogic.web.Document doc = new umbraco.cms.businesslogic.web.Document(1056);
umbraco.cms.businesslogic.property.Property prop = doc.getProperty("umbracoNaviHide");


But 'prop' is null.

Can someone tell me the right way to get a generic property?

Thanks!
mels
Posted: Friday, January 04, 2008 3:57:39 PM
Rank: Newbie

Joined: 1/4/2008
Posts: 2
Hi again...

I've found out what the problem was.

It works when i copy my user control to the umbraco site, and not when i'm testing it in Visual Studio.
hoehler
Posted: Friday, January 04, 2008 4:48:49 PM

Rank: Addict

Joined: 7/19/2006
Posts: 597
Location: Bad Homburg, Germany
Sure, the umbraco dlls are runnning in the context of an umbraco installation. Just one hint: for reading (not for saving or publishing) you can better use the umbraco.presentation.nodeFactory namespace...

Thomas

• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
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.