Problem implementing Paging with object type Dictionary<>
Hi,
I am trying to implement the solution per the post on 6/1/2010 from this thread.
http://forums.ext.net/showthread.php...taTable-Paging
However whenever I run my webservice I get the following error:
Cannot serialize member Ext.Net.Paging`1[[System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Data of type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], because it implements IDictionary
My code is very similar to the one posted.
Code:
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = false)]
public Paging<Dictionary<string, object>> FindPagingData(int start, int limit, string sort, string dir,
DateTime dt)
{
MyRepository repos = new MyRepository();
List<Dictionary<string, object>> lstData = new List<Dictionary<string, object>>();
lstData = repos.FindData(dt: dt);
if ((start + limit) > lstData.Count)
{ limit = lstData.Count - start; }
List<Dictionary<string, object>> rangeData = (start < 0 || limit < 0) ? lstData : lstData.GetRange(start, limit);
return new Paging<Dictionary<string, object>>(rangeData.AsEnumerable(), lstData.Count);
}
repos.FindData returns a List<Dictionary<string,object>>
Thank you.