//[ValidateAntiForgeryToken] public ActionResult ListEditors(int productItemId) { if (ModelState.IsValid) { // Custom Validation: the selected combobox value should be in the list if (ProductItems.GetAvailableForUserList().FindIndex(i => i.Id == productItemId) != -1) { // DoSomethig(productItemId); } else { ModelState.AddModelError("", "Invalid input. Looks like a hacker attack."); } } return(View("ListEditors", productItemId)); }
public ActionResult ListEditors() { return(View("ListEditors", ProductItems.GetAvailableForUserList()[0].Id)); }