Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
in my view i created a two dimensional array.and i assigned that value to one variable.now i want to use that array as a parameter to a method in the controller.how can i pass that array to the controller.

view code is:
C#
var gridArray = new Array(g_rows);
            for (var i = 1; i < g_rows; i++) {
                    gridArray[i] = new Array(g_colums);
                    for (var j = 1; j < g_colums; j++) {
                        var val = mygrid.cells(i,j).getValue();
                         gridArray[i][j] = val;
Posted
Updated 23-May-12 1:24am
v2

1 solution

You should look at using a "view model". You basically create "Models" just for your view that contain the data items you need in your view. It is a great way of getting data in and out of your view.

You can refer the link at http://stephenwalther.com/blog/archive/2009/04/13/asp-net-mvc-tip-50-ndash-create-view-models.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900