Ejemplo n.º 1
0
 //[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));
 }
Ejemplo n.º 2
0
 public ActionResult ListEditors()
 {
     return(View("ListEditors", ProductItems.GetAvailableForUserList()[0].Id));
 }