How do I get the selected item from drop down list and submit it to my Details view?

后端 未结 2 1297
灰色年华
灰色年华 2021-01-26 03:30

I have an mvc razor form. What i want is to submit the user\'s selection from Items dropdown list and navigate to Details view in order to access the chosen item\'s information.

2条回答
  •  攒了一身酷
    2021-01-26 03:54

    use Items in Details method if you want to get Items value

      public ActionResult Details(int Items)
        {
            var item = db.Items.Find(Items);
    
            return View(item);
        }
    

提交回复
热议问题