Skip to content Skip to sidebar Skip to footer

"the Json Request Was Too Large To Be Deserialized" Mvc Knockoutjs

I've been scrapping the threads for an answer in similar threads with no luck. I am using knockoutJS to pass the information back from my partial view and I am getting the 'The JSO

Solution 1:

I added the key below and it worked for me.

<appSettings><addkey="aspnet:MaxJsonDeserializerMembers"value="150000" /></appSettings>

Solution 2:

This may be by design.... to protect the site from DoS attacks or time-out conditions

There is an app setting for MaxJsonDeserializerMembers which you may be able to increase, but would need to be done with care: ...JSON payload members fails with an exception

What I have done in the past is to either break up the forms into (collapsible) sections and doing AJAX posts by group, or spreading the form out over multiple pages. Front end users generally will be happier if anything as they don't see the gazillion fields at once.

Solution 3:

I've had the same error message when I returned partial view via ajax call. It turned out that the problem was in the partial - "Object Reference not set to an instance of an object".

@User.Address.Address1

The "Address" was null. Fixed that by doing some checks

@if(User.Address != null){
   @User.Address.Address1
}

Post a Comment for ""the Json Request Was Too Large To Be Deserialized" Mvc Knockoutjs"