suman goud

suman goud

  • NA
  • 176
  • 52.8k

How to bind data in two drop down list in single action

Aug 3 2016 7:33 AM
 i have two drop down list in my view page, am binding data to one drop down on one condition,
how to bind data to another drop down with different condition. am using entity model
 
 
public ActionResult Index()
{
TestDemoEntities objentity = new TestDemoEntities();
List<MasterNode> objCustomerList = (objentity.MasterNodes.Where(x => x.Type == "Master")).ToList();
SelectList objmodeldata = new SelectList(objCustomerList, "EmpID", "Name", 0);
CustomerModel objCustomerModel = new CustomerModel();
objCustomerModel.CustomerListModel = objmodeldata;
return View(objCustomerModel);
}
view
@Html.DropDownList("ddlCustomer", Model.CustomerListModel)
 
 
i want to bind data to one more drop down with different condition 

Answers (1)