[ValidateAntiForgeryToken] [HttpPost] // action method requested directly from view public ActionResult SubmitViolation(ViolationViewModel violationVM, string operation) { if (operation == "Submit") { SaveViolation(violationVM); // calling sub methods based on operation value } else if (operation == "Certify") { CertifyViolation(violationVM); } } // StaffAuthorize is custom authorize filter that accepts type of operation and checks the authorization permissions [StaffAuthorize(Enums.StaffFunction.Violations_Save)] public ActionResult SaveViolation(ViolationViewModel violationVM) { // Save Violation implementation return View(); } [StaffAuthorize(Enums.StaffFunction.Violations_Certify)] public ActionResult CertifyViolations(ViolationViewModel violationVM) { //Certify Violations implementation return View(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)