Skip to content
Loading
How to pass data from view to controller using model binding
controller
  1. public ActionResult FilterLOV(int? txtemployeeID, string txtemployeeName, int? txtemployeeAge,int? droLocation)  
  2. {  
  3. List empSearch = new List();  
  4. IEmployeeDemoBusinessService empSearchBS = new EmployeeDemoBusinessService();  
  5. empSearch = empSearchBS.GetEmployeeByFilter(txtemployeeID, txtemployeeName,txtemployeeAge, droLocation);  
  6. return PartialView("EmplyeeDemoGridPartial", empSearch);  
  7. }  
Model
  1. public class EmployeeDashboardModel  
  2. {  
  3. public List EmpListLOV { getset; }  
  4. public List LocationLOV{get;set;}  
  5. public List maritial_StatusList { getset; }  
  6. }  
Firstly i was using ajax call to pass the data from the view to controller but i want to do the same with model binding.
 
Please suggest.

2 Replies

Know the answer? Post it — somebody with the same question will find it here.