I get this error when I add an attribute to a node with a value greater than 10 and then do a postback on the page.
Sys.WebForms.PageRequestManagerServerErrorException: Unable to cast object of type 'System.Int64' to type 'System.String'.
node.Attributes.Add("ID", "10") doesn't cause an exception
node.Attributes.Add("ID", "11") does cause an exception