public ActionResult Share(int taskId, string objectId, string displayName, string delete, string shareTasks) { // If the share button was clicked, share the task with the user or group if (shareTasks != null && objectId != null && objectId != string.Empty && displayName != null && displayName != string.Empty) { TasksDbHelper.AddShare(taskId, objectId, displayName); } // If a delete button was clicked, remove the share from the task if (delete != null && delete.Length > 0) { TasksDbHelper.DeleteShare(taskId, delete); } return(RedirectToAction("Share", new { id = taskId })); }