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.
Unfortunately, activation email could not send to your email. Please try again.

How to resolve 'Value cannot be null' exception during post back

How to resolve theValue cannot be null exception in Grid.

This exception is raised when GridAction is returned on an external AJAX Post. The cause for this exception is PagingParams is Null.

Use a condition to check whether the Post is external AJAX Post. It can be done by checking whether any of the values in PagingParams are null using the code if(args.ID == null) because for external AJAX Post PagingParams will always be null. If it is null don’t return GridAction instead return respective action result here we return Partial View so that this exception is resolved.

CSHTML:

 

CONTROLLER:

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2354 07/08/2014 07/10/2014 ASP.NET MVC (Classic) Grid 4.5 12.1.0.43
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.