views:

33

answers:

1
  [AcceptVerbs( HttpVerbs.Post )]
    public JsonActionResult<BaseAsyncResponse> Add(
        long[] IdList )
    {
           for (int i = 0; i < IdList.Length; i++)
                {
                        // do something
                }
    }



  var o = {
            url: addButton.action.url
                , method: addButton.action.method
                , params: { 'IdList': Ext.encode(allIds) }
          };
        Ext.Ajax.request(o);

I am trying to pass a long[] to code behind from an Ajax call. The IdList currently comes in as a string which I convert into a JsonArray. Is there a ways to use the bind attribute ?

A: 

If you want to use DefaultModelBinder your request content should look like:

IdList[0]=100&IdList[1]=200&IdList[2]=300&IdList[3]=400&...&IdList[n]=...
eu-ge-ne
can you elaborate more on this?