Sending a JSON array to be received as a Dictionary<string,string>

Posted by James Bond on Stack Overflow See other posts from Stack Overflow or by James Bond
Published on 2010-03-22T17:18:30Z Indexed on 2010/03/22 17:21 UTC
Read the original article Hit count: 403

Filed under:
|
|
|

I have a method with the following signature:

public ActionResult RenderFamilyTree(string name, Dictionary<string, string> children)

I'm trying to call it from javascript using jQuery like this:

$('#div_render').load(
    "<%= Url.Action("RenderFamilyTree") %>", 
    { 
         'name': 'Raul',
         [
             {'key':'key1','value':'value1'},
             {'key':'key2','value':'value2'}
         ] 
    }, 
    function() {                
        alert('Loaded');
    }
);

Am I missing something to get this to work?

© Stack Overflow or respective owner

Related posts about c#

Related posts about dictionary