amShekar

amShekar

  • NA
  • 39
  • 60.8k

How to bind selected checkbox model prperties to MVC Model

Feb 27 2014 1:30 PM
I have a model class which is having several list properties among list properties , I am displaying one list in the multi selection checkbox .
 
How to bind selected checkbox properties to model on selection of checkbox on post method.
 
ex
 
 public class Gadgets
{
public int Id {get;set;} 
public List<Mobiles> {get;set;} 
public List< Product> {get;set;}
 
 
 
public class Product
{
public int productId {get;set;}
public string productName {get;set;} 
public string productDescription{get;set:} 
 
 
 
In my view
<input type="checkbox" /><label>@Model.ProductName </label>
When user clicks on  checkbox how to post selected product name descriptio and name to Gadget model