Copied to clipboard

Flag this post as spam?

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


  • Zac 239 posts 541 karma points
    Aug 06, 2013 @ 21:11
    Zac
    0

    Umbraco 6 compatibility?

    Will this currently work or are there plans to make this work with umb 6?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 06, 2013 @ 21:55
    Matt Brailsford
    100

    Hey Summit

    This should work with V6 as is (I'm currently using it on a few v6 projects myself with no problems)

    Many thanks

    Matt

  • Zac 239 posts 541 karma points
    Aug 06, 2013 @ 21:56
    Zac
    0

    Great. Thanks

  • Anders Burla 2560 posts 8256 karma points
    Sep 25, 2013 @ 23:32
    Anders Burla
    0

    How to fetch the id's in MVC? Should it be saved as xml or JSON?

    Kind regards
    Anders

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Sep 26, 2013 @ 09:34
    Matt Brailsford
    0

    Hey Anders

    I tend to use JSON in MVC, then just create a helper method to convert the JSON to a dictionary:

    public static class StringExtensions
    {
        public static T DeserializeJsonTo<T>(this string json)
        {
            return new JavaScriptSerializer().Deserialize<T>(json);
        }
    }
    

    Then do something like this to get the values:

    var cell = "cel1";
    var widgets = Model.Content.GetPropertyValue<string>("widgets")
        .DeserializeJsonTo<Dictionary<string, int[]>>();
    
    if(widgets.ContainsKey(cell))
    {
        var nodeIds = widgets[cell];
        // Process node ids
    }
    

    Hope that helps

    Matt

  • Anders Burla 2560 posts 8256 karma points
    Sep 26, 2013 @ 09:46
    Anders Burla
    0

    Thanks - will try that

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft