from umbraco.NodeFactory to umbraco.presentation.nodeFactory
Hello everyone,
I wrote a user control in .NET 4 with Umbraco 4.7. Now I want to deploy this on a server that runs Umbraco 4.5 and .NET 3.5...
So, I tinkered the project to make it compile in 3.5; apparantly I also needed to switch the namespace "umbraco.NodeFactory" into the old "umbraco.presentation.nodeFacotry". This finally compiled without problems, but the result is different.
for example this line:
s.Append(hotspot.GetProperty("link"));
Should append the property 'link' of the node 'hotspot' into stringbuilder s, right? What it actually returns is this:
"umbraco.presentation.nodeFactory.Property" And that goes for every property I tried to fetch using the GetProperty...
Does anyone know how I can get it back to work? Thanks in advance.
You're correct in that the namespace changed in 4.6 (or 4.7?), if you want to be compatible with 4.5 you'd need to use umbraco.presentation.nodeFactory
But to get the actual value of a property you should use the .Value property:
s.Append(hotspot.GetProperty("link").Value);
You may also want to test for the property itself being null first before you get the Value property.
from umbraco.NodeFactory to umbraco.presentation.nodeFactory
Hello everyone,
I wrote a user control in .NET 4 with Umbraco 4.7.
Now I want to deploy this on a server that runs Umbraco 4.5 and .NET 3.5...
So, I tinkered the project to make it compile in 3.5; apparantly I also needed to switch the namespace "umbraco.NodeFactory" into the old "umbraco.presentation.nodeFacotry". This finally compiled without problems, but the result is different.
for example this line:
s.Append(hotspot.GetProperty("link"));
Should append the property 'link' of the node 'hotspot' into stringbuilder s, right?
What it actually returns is this:
"umbraco.presentation.nodeFactory.Property"
And that goes for every property I tried to fetch using the GetProperty...
Does anyone know how I can get it back to work? Thanks in advance.
Hi,
You're correct in that the namespace changed in 4.6 (or 4.7?), if you want to be compatible with 4.5 you'd need to use umbraco.presentation.nodeFactory
But to get the actual value of a property you should use the .Value property:
You may also want to test for the property itself being null first before you get the Value property.
HTH,
Tom
Allright, that works perfectly.
Thanks a lot!
is working on a reply...