(Using the latest MVC 2 RC 2) I am trying to sort some XML in LINQ (C #) using an element attribute value ...
var sites = from s in xDoc.Element("sites").Elements("site") orderby s.Attribute("name") select s;
But when I pass this to my view, I get an exception:
Exception Details: System.ArgumentException: At least one object must implement IComparable. Source Error: Line 37: </th> Line 38: </tr> Line 39: <% foreach (var item in Model) Line 40: { %> Line 41: <tr>
Can someone tell me how to sort XML using LINQ and display it correctly?
sorting xml linq asp.net-mvc
Matt w
source share