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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to pass an array of integers in Json mode actions?

Platform: ASP.NET MVC (Classic) |
Control: Grid


To pass an array or a list of integers from the view to post action.


In order to pass the array value to the post action, you need to serialize the array value and pass the serialized data to the mapper action. In the post action, you can de-serialize the serialized data and use the data based on your requirement.



int[ ] numbers={1,2,3,4,5};






   .Mappers(map => { map.Action("GridFeatures", new { numbersCollection = Newtonsoft.Json.JsonConvert.SerializeObject(numbers) }); })



using System.Web.Script.Serialization;

namespace Grid.Controllers


    public partial class GridController: Controller


 public ActionResult GridFeatures()


           return View();



        public ActionResult GridFeatures(PagingParams args, string numbersCollection)


            var numberdata = new JavaScriptSerializer().Deserialize(numbersCollection, typeof(int[ ]) );

                return data.GridJSONActions< Student>();




Note: Refer the System.Web.Script.Serialization library in the controller.

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile