We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error on Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

128496 Jan 25,2017 05:21 PM UTC Jan 27,2017 11:13 AM UTC ASP.NET MVC 3
loading
Tags: Grid
Dayne
Asked On January 25, 2017 05:21 PM UTC


Hi,

The references of the syncfusion libraries in the layout page makes that the functions in my controller page are called several times, and it provoques that many of my temporary variables loose their values.

Is there a way to avoid this behavior?

I tried to comment this references in the layout page, and put them in my view page as follows

@section scripts{    
    <script src="~/Scripts/ej/web/ej.web.all.min.js"></script>
    @Scripts.Render("~/Scripts/jquery.easing.1.3.js")
    @Scripts.Render("~/Scripts/jsrender.min.js")
    <link rel='nofollow' href="~/Content/ej/web/bootstrap-theme/ej.web.all.min.css" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
    <script type="text/javascript">
........

</script>
But I get the following error

Type 'System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for serialization/deserialization of a dictionary, keys must be strings or objects.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Type 'System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for serialization/deserialization of a dictionary, keys must be strings or objects.

Source Error: 

 

Line 104:</div>

Line 105:            @Html.EJ().ScriptManager()

Line 106:            @(Html.EJ().Grid<DatosCapacitacion>("GridCapacitaciones")

Line 107:            .Datasource((IEnumerable<DatosCapacitacion>)ViewBag.Capacitaciones)

Line 108:            .Locale("es-MX")


Source File: C:\Users\laura.jordan\Documents\TRABAJO\Proyectos\RRHH\HumanResoursesJAR\HumanResourcesJAR\Views\CapitalHumano\Capacitaciones.cshtml    Line: 106 



Thanks in advance

Saravanan Arunachalam [Syncfusion]
Replied On January 26, 2017 10:51 AM UTC

HI Dayne, 
Thanks for contacting Syncfusion’s support. 
We suspect that you have tried to convert the Dictionary object with integer key and object value as JSON by using JavaScriptSerializer which is the cause of the issue. So, please refer to the below stackoverflow link to resolve the issue. 
Regards, 
Saravanan A. 


Dayne
Replied On January 26, 2017 03:55 PM UTC

Ok, I fix the error, but the main issue still persist.

In my layout page, I have this code, among other things:
.......
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/waitMe/waitMe.js" type="text/javascript"></script>
    @Scripts.Render("~/Scripts/jquery.easing.1.3.js")
    @Scripts.Render("~/Scripts/jsrender.min.js")
    <script src="~/Scripts/ej/web/ej.web.all.min.js"></script>
    @RenderSection("scripts", required: false)
    @Html.EJ().ScriptManager()
......

And I have a view wich is a formulary page, in the controller functions (GET and POST) of that view I have many temporary variables, so, in debug mode I realized that when the user request a POST action, the controller function is called several times, making that the temporary variables loose their value.

Sorry If my English is not good enough, I could try to explan it in Spanish..

Venkatesh Ayothi Raman [Syncfusion]
Replied On January 27, 2017 11:13 AM UTC

Hi Dyane, 
Thanks for the update. 
The reported issue is reproduced in two ways. First the JavaScriptSerializer don’t deserialize the dictornary object and second, if you have any complex types and dates. So, we suggest you to use Newtonsoft.json for deserialize your Dictionary objects or complex types. Please refer to the online forum for your reference, 

Regards, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;