Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
MVC Grid JsonReaderException exception
posted

All grids for MVC 19.1 throws exception in this row for HttpPost. HttpGet works correct. It also worked in MVC 17.2. How I can fix or debug JSON content for grids/datasets?  

@(Html.Infragistics().Grid(Model))

JsonReaderException: Unexpected character encountered while parsing value: _. Path '', line 0, position 0.]
   Newtonsoft.Json.JsonTextReader.ParseValue() +1111
   Newtonsoft.Json.JsonTextReader.Read() +26
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) +94
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) +689
   Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +469
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) +145
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, JsonSerializerSettings settings) +53
   Infragistics.Web.Mvc.GridModel.DataBindInternal() +1203
   Infragistics.Web.Mvc.GridModel.DataBind() +45
   Infragistics.Web.Mvc.InfragisticsSuite`1.SetupGrid(IGridModel gridViewModel) +53
   ASP._Page_Views_Item_List_cshtml.Execute() in d:\TFS\Cyberbahn\Development\Net\Mdo\Intranet\Views\Item\List.cshtml:151
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +86
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +104
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +31
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +187
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +27
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +41
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously
Parents
  • 485
    Offline posted

    Hello Yuri,

     

    Thank you for posting in our forum.

     

    This error usually gets thrown when you try to deserialize something that is not a valid JSON, or not JSON at all – a similar issue is discussed in this StackOverflow thread.

    I would suggest that you try the two online tools that the answer there suggests:  one is for validating the JSON and the other one - to generate C# from it.

     

    Some additional information with regard to your scenario would be much appreciated:

     

    1. What kind of content do you POST to the server?
    2. How do you create this POST request – is it created by the igGrid, or some form submission button?
    3. What do you mean by “All grids for MVC 19.1 throws exception” – do you have more than one grid on the same page, or different grids and all of them throw the same error?
    4. What is the grid initialization configuration that you use? Have you enabled some features, or set some options?

     

    I look forward to hearing from you.

Reply Children