public ActionResult SendRequest(int id) { var model = PostRepo.ApplyPost(id, HttpUtil.UserProfile.ID); if (model.HasError) { ViewBag.Error = model.Message; } else { ViewBag.Success = "You have applied for this post"; } return(RedirectToAction("PostHomeTeacher")); }