Hi I have a the following scenario
Table - Items
id int (PK),
name varchar(100)
Table - Category
id int (PK),
name varchar(100)
Table - Category_item
category_id int (FK),
item_id int (FK)
I’m using Asp.Net MVC and Entitydatamodel.
In the view I have a dropdown list to show the categories and a check boxes to display item.
I want to insert into the Table – Category_item when i select the category and curresponding items.
How can i do it? How can I pass the values from the view to the controller?
The anwser is that it depends. But the general case is (RAZOR)
You can use
Html.DropDownListForand then the Save action will already be bounded with correct value. ‘db’ is the model context.