Populate flexigrid with ASP.Net WebMethod

kimt

New Member
I have an ASP.Net page containing a table and code to create a flexigrid.\[code\]<script type="text/javascript"> $(function() { $("#grid").flexigrid( { url: 'Default.aspx/GetData', dataType: 'json', colModel: [{ display: 'Col1', name: 'Col1', sortable: true }] }); });</script>\[/code\]And the table:\[code\]<table id="grid"></table>\[/code\]The WebMethod is declared in the code behind as follows:\[code\] [WebMethod] public static string GetData() { return "[{\"Col1\":\"val1\"}]"; }\[/code\]However the WebMethod is never called by flexigrid.I have checked that the WebMethod can be called using the code below and this succeeds. Is there something I'm missing when using flexigrid with ASP.Net WebMethods?\[code\] $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetData", data: "{}", dataType: "json" });\[/code\]ThanksAlan.
 
Back
Top