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 All,
Is there a way to convert the result of a true false data type's case from mixed to lower.
I have tried @propertyname.ToLower() which works with a text data type, however not with a T/F data type
Cheers,
Hi Bob,
The reason why you can´t use @propertyname.ToLower() on a True/False data type is because it´s return a integer. When the checkbox is unchecked it return the value 0 and when it´s checked it return the value 1.
/Dennis
Ah right that makes sense. Was a little confused as when I displayed the value on screen it showed the result as True or False.
Thanks for the help
I think you can do @propertyName.ToString().ToLower() for what you want?
Jeavon
Just checked and it works fine:
MVC Typed:
@Model.Content.GetPropertyValue("umbracoNaviHide").ToString().ToLower()
MVC Dynamic:
@CurrentPage.umbracoNaviHide.ToString().ToLower()
Razor Macro (DynamicNode)
@Model.umbracoNaviHide.ToString().ToLower()
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Convert True/False field case
Hi All,
Is there a way to convert the result of a true false data type's case from mixed to lower.
I have tried @propertyname.ToLower() which works with a text data type, however not with a T/F data type
Cheers,
Hi Bob,
The reason why you can´t use @propertyname.ToLower() on a True/False data type is because it´s return a integer. When the checkbox is unchecked it return the value 0 and when it´s checked it return the value 1.
/Dennis
Ah right that makes sense. Was a little confused as when I displayed the value on screen it showed the result as True or False.
Thanks for the help
Hi Bob,
I think you can do @propertyName.ToString().ToLower() for what you want?
Jeavon
Just checked and it works fine:
MVC Typed:
MVC Dynamic:
Razor Macro (DynamicNode)
is working on a reply...