When I try to display the result, I receive this error: Error loading Razor Script TabellaArchivioAlbo.cshtml Object reference not set to an instance of an object.
I tried to display the umbraco properties and it work properly, but if i try to access node custom properties (like "numero") I always receive the above error.
I searched all properties and retrieve only the ones I need.
@foreach(var prop in doc.getProperties) { var alias = prop.PropertyType.Alias; if ((alias=="numero") || (alias=="del") || (alias=="oggetto")) { var propValue = prop.Value; <td>@propValue</td> } }
[URGENT] I cannot retrieve properties value of unpublished node
Hello,
I must display a list of unpublished nodes.
My actual code is:
When I try to display the result, I receive this error:
Error loading Razor Script TabellaArchivioAlbo.cshtml
Object reference not set to an instance of an object.
I tried to display the umbraco properties and it work properly, but if i try to access node custom properties (like "numero") I always receive the above error.
Can anybody help me?
Thank you in advance
Adriano
Solved!!!
I searched all properties and retrieve only the ones I need.
@foreach(var prop in doc.getProperties)
{
var alias = prop.PropertyType.Alias;
if ((alias=="numero") || (alias=="del") || (alias=="oggetto"))
{
var propValue = prop.Value;
<td>@propValue</td>
}
}
It work correctly.
is working on a reply...