I am unable to access custom properties from codein c#
I am unable to access custom properties from codein c#
On a web page of a given document type I have (old) properties where everything works fine, Ie I get the value from code.
But when I added two new properties today on the very same web page, I am unable to access the new values from code.
This (old) on works:
string cid = Umbraco.Field("customerID", recursive: true).ToString();
=>Return the value: 2
Neither of these work (the first is true/false, set to true, the second is string set to "true":
string a = Umbraco.Field("showaddresssearchforadmonlystring", recursive: true).ToString();
=>Return: empty string
bool a = Convert.ToBoolean(Umbraco.Field(" showaddresssearchforadmonly", recursive: true));
=>Return: Unable to cast object of type 'System.Web.HtmlString' to type 'System.IConvertible'.
Both
=>And yes before you ask: I have checked case and yes all three values are custom properties on the very same web page two levels above the active web page.
I am unable to access custom properties from codein c#
I am unable to access custom properties from codein c# On a web page of a given document type I have (old) properties where everything works fine, Ie I get the value from code. But when I added two new properties today on the very same web page, I am unable to access the new values from code.
This (old) on works: string cid = Umbraco.Field("customerID", recursive: true).ToString(); =>Return the value: 2 Neither of these work (the first is true/false, set to true, the second is string set to "true": string a = Umbraco.Field("showaddresssearchforadmonlystring", recursive: true).ToString(); =>Return: empty string bool a = Convert.ToBoolean(Umbraco.Field(" showaddresssearchforadmonly", recursive: true)); =>Return: Unable to cast object of type 'System.Web.HtmlString' to type 'System.IConvertible'. Both
=>And yes before you ask: I have checked case and yes all three values are custom properties on the very same web page two levels above the active web page.
Any clues would be appreciated.
is working on a reply...