Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andy_rose 91 posts 117 karma points
    Aug 03, 2011 @ 13:15
    andy_rose
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft