Hi
I created a new razor partial view in Umbraco 6. I am trying to compare the value of a True/False field but get an error.
If I write the True/False value to screen I get the word True. But if I try to compare on that word it fails.
The code is:
@if (item.GetPropertyValue("myTrueFalseField") == "True")
{
Do something
}
Nothing happens, if I try this I get a script error:
@if (item.GetPropertyValue("myTrueFalseField").ToString() == "True")
{
Do something
}
I think I am missing something.
Thanks
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/40692-getpropertyvalue-for-true-false