In my application there is an edit page, which contains a list of data through a viewmodel. this viewmodel contains two list, i.e. List and List.
In the view, there are multiple row of data from the lists, and i want to edit the rows and send to the controller to save the data. For this, i am usuing - @using (Html.BeginForm("Submit", "ControllerName", FormMethod.Post)) {-----}
however, on submit button press, when the control moves to the action method, there i found, the data is retrieving as null. below is the action method -
public ActionResult Submit(ViewModel _ViewModel)
{
//
} with a debug point, i found the view model is null for both the list.
below is the view model class -
public class ViewModel
{
public List Model1List { get; set; }
public List Model2List { get; set; }
} could anyone let me know the way to pass the data to controller?
RAHUL NATHPosted Aug 21, 2018, 2:47 AM
Jignesh KumarPosted Aug 20, 2018, 10:49 AM