This is a migrated thread and some comments may be shown as answers.

[Solved] URL did not return JSON with ajax sorting

1 Answer 170 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anton
Top achievements
Rank 1
Anton asked on 28 Feb 2011, 09:20 PM

“Error! The requested URL did not return JSON” comes up with ajax-sorting the Grid’s fields after adding Include clause to Entity Framework data query. All is done exactly in according to schema specified here: http://demos.telerik.com/aspnet-mvc/grid/ajaxbinding . Note, data does come with Include in query, just sorting is failed. Moreover, I do not have same problem anywhere else in other Project’s Grids even with using Include in request statements.

If exclude Include from mentioned query, sorting works well on all fields with no exceptions. But since I need associative fields, I have to use Include what in turn results the exception.

FireBug returns just Error word in XHR->Response content after hitting on any sorting field.

Any ideas how to fix or localize the issue or what the restrictions can be for using Include in Entity Framework query for MVC Grid Ajax sorting?

1 Answer, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 05 Jan 2012, 09:47 PM
that might have to do with JSON not being able to serialize the information that "Include" is bringing.
I had the same issue and had to do this:

context.Configuration.ProxyCreationEnabled = false

 

//or context.ObjectContext.ContextOptions.ProxyCreationEnabled = false;

which is a bummer and you cannot take advantage of EF 4.2 navigation properties.

what did you end up doing? I see this post is old and you may have found a better solution
thanks

Tags
Grid
Asked by
Anton
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Share this question
or