Copied to clipboard

Flag this post as spam?

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


  • Vladimir Korotenko 1 post 21 karma points
    Feb 21, 2012 @ 11:59
    Vladimir Korotenko
    0

    Strange logic of OrderBy method

    Hi all! I'm novice in Umbraco and test OrderBy method for sorting menu items. I create contentType and add properties "mo" with type "TextString" and fill him 1,2,3 etc.

    In partial view i'm using next code:

    @foreach (var item in Homepage.Children.OrderByDescending("mo")) 

    // and have next error:

    Object must be of type String. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Object must be of type String.

    What's wrong? Many thanks in advance for any help or a link to how to use this method and the like.

Please Sign in or register to post replies

Write your reply to:

Draft