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.
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);
}
A dropdown only sends simple values. The name usually have to match the name of the parameter in the method signature. Remember that it is the name attribute that is the key in the querystring, and not the id attribute. Hence the use of department in this example and Items in @Murali's answer.
Try changing your details method to:
public ActionResult Details(string department)
{
var item = db.Items.Find(department);
return View(item);
}