I am using the FlexiGrid jQuery plug in and I need to get a JSON object back form my MVC App, simple enough if the FlexiGrid took just the object but I need to add a few items to the response string for it to work properly with FlexiGrid.
So here is a portion of my controller code:
If Request.QueryString("json") IsNot Nothing Then
Dim data As New StringBuilder()
data.Append("page: " & pageIndex & "," & vbCrLf)
data.Append("total: " & ViewData.TotalCount & "," & vbCrLf)
data.Append("rows: ")
data.Append(Json(objCustomerList))
Return Content(data.ToString())
End If
Unfortunately in the above code Json(objCustomerList)
returns 'System.Web.MVV.JsonResult' instead of the desired JSON string data. I also tried Json(objCustomerList).ToString()
just to see what would happen and the same thing again.
Any ideas?