Razor script error "Input string was not ina correct format"
I am getting the following error on one of my nodes and I am not sure why. The following code demonstrates what I am trying to do and the property I am trying to access is a uComponent multi tree picker.
if (Model.MyProperty != null) { foreach (XElement item in Model.MyProperty.BaseElement.Elements("nodeId")) { myProps.Add(item.Value); } }
I am getting an exception whenever I try and access the property when no items have been selected. Is there a way I can test for this before trying to access the property? I would prefer not to stick it all in a try/catch although I guess that would work.
Razor script error "Input string was not ina correct format"
I am getting the following error on one of my nodes and I am not sure why. The following code demonstrates what I am trying to do and the property I am trying to access is a uComponent multi tree picker.
if (Model.MyProperty != null)
{
foreach (XElement item in Model.MyProperty.BaseElement.Elements("nodeId"))
{
myProps.Add(item.Value);
}
}
I am getting an exception whenever I try and access the property when no items have been selected. Is there a way I can test for this before trying to access the property? I would prefer not to stick it all in a try/catch although I guess that would work.
is working on a reply...