Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
i have a simple razor-script. It works in umbraco 4.7.0 and 4.7.1 perfectly:
if (@item.HasProperty("bodyText")) { if(@item.bodyText!="") { <p class="flex-caption">@item.bodyText</p> } }
But in Umbraco 4.9 i get only this simple error message:
Error loading MacroEngine script
If I write String.Empty instead of "" it doesn't work too.
The problem is the second if-statement. Without this second if-statement it works....
Have anyone an idea to solve this error?
Regards Sören
Now, it works with following code:
if (@item.HasProperty("bodyText")) { if(@item.bodyText.ToString()!=String.Empty) { <p class="flex-caption">@item.bodyText</p> } }
I must add .ToString()
I'm confused, because the property with alias bodyText has the datatype tinyMCE and in 4.7.1 it works without .ToString().
Are their any changes in Razor in Umbraco 4.9???
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Razor error in umbraco 4.9 with empty string
Hi,
i have a simple razor-script. It works in umbraco 4.7.0 and 4.7.1 perfectly:
But in Umbraco 4.9 i get only this simple error message:
Error loading MacroEngine script
If I write String.Empty instead of "" it doesn't work too.
The problem is the second if-statement. Without this second if-statement it works....
Have anyone an idea to solve this error?
Regards Sören
Now, it works with following code:
I must add .ToString()
I'm confused, because the property with alias bodyText has the datatype tinyMCE and in 4.7.1 it works without .ToString().
Are their any changes in Razor in Umbraco 4.9???
Regards Sören
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.