[CLOSED] Help with JSON function

  1. #1

    [CLOSED] Help with JSON function

    I need to solve this function

    protected void GetJSON() {
    
            
                String StrDatos;
                StrDatos = "{\r\n  \"EventId\": 1001,\r\n  \"CalendarId\": 4,\r\n  \"Title\": \"CITA\",\r\n  \"StartDate\": \"2014-05-29T10:00:00\",\r\n  \"EndDate\": \"2014-05-29T10:15:00\",\r\n  \"Location\": \"\",\r\n  \"Notes\": \"MARIO PEREZ\",\r\n  \"Url\": \"\",\r\n  \"IsAllDay\": false,\r\n  \"Reminder\": \"\",\r\n  \"IsNew\": false,\r\n  \"cls\": \"ext-cal-ev\",\r\n  \"_positioned\": true,\r\n  \"_left\": 0,\r\n  \"_width\": 100,\r\n  \"_top\": 420,\r\n  \"_height\": 15,\r\n  \"_weekIndex\": 4,\r\n  \"spanLeft\": false,\r\n  \"spanRight\": false,\r\n  \"spanCls\": \"\"\r\n}";
            
                    try{
                        Dictionary<string, string>[] deserializedJSON = Ext.Net.JSON.Deserialize<Dictionary<string, string>[]>(StrDatos);    
                    }catch(Exception errx){
                        X.Msg.Alert("TEST",errx.Message.ToString()).Show();
                    }
                
                
            
            }
    Last edited by Daniil; Jun 03, 2014 at 2:05 PM. Reason: [CLOSED]
  2. #2
    Hi @mapperez,

    I don't think that a JSON object can be deserialized to an array of Dictionaries.

    But it can be deserialized into a Dictionary itself. So, if you change
    Dictionary<string, string>[]
    to
    Dictionary<string, string>
    it should work.

Similar Threads

  1. [CLOSED] Using JSON.Serialize() and JSON.Deserialize()
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 30, 2013, 2:37 PM
  2. JSON alternative
    By MGholam in forum Feature Requests
    Replies: 1
    Last Post: Nov 22, 2011, 12:15 AM
  3. Crud json
    By oseqat in forum 1.x Help
    Replies: 0
    Last Post: Jul 11, 2011, 1:05 PM
  4. [CLOSED] Json 4.0
    By majunior in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 24, 2011, 6:32 PM
  5. How to select row by JSon...
    By rebulanyum in forum 1.x Help
    Replies: 0
    Last Post: Mar 03, 2010, 5:29 AM

Posting Permissions