Added a property to Sample Website Home page but can't access it.
Not sure why, but I added a property named "Test Property" which created testProperty of type Umbraco.TextBox to Home but I can't access it's values or even the property at all. Using the same example in Master...
var home = (Home)Model.Root();
var font = home.Font;
// mine
var test = home.testProperty;
I get the error
Compiler Error Message: CS1061: 'Home' does not contain a definition for 'testProperty' and no accessible extension method 'testProperty' accepting a first argument of type 'Home' could be found (are you missing a using directive or an assembly reference?)
Added a property to Sample Website Home page but can't access it.
Not sure why, but I added a property named "Test Property" which created testProperty of type Umbraco.TextBox to Home but I can't access it's values or even the property at all. Using the same example in Master...
I get the error
What am I missing here?
Hello Edgar,
the DocumentType you changed and try to access is "Home"? Then your cast seems right.
But properties always start with captial letters. So it should be "TestProperty".
Hope this helps, Arnim.
This is not working.... Maybe I am doing this wrong??? Something this simple shouldn't give me any issues....
Here is a picture of what I did...
Huh.... I can get the value using home.Value("testProperty")
How is "Font" setup where it is accessible via home.Font?
is working on a reply...