public ActionResult Delete(int objectid, int pollid) { if (Session["uid"] == null || Session["uid"].ToString().Equals("")) { return RedirectToAction("Index", "Home"); } if ((int)Session["user_type"] < User_Type.POLL_CREATOR) { return RedirectToAction("Invalid", "Home"); } pollObjectModel ob = new pollObjectModel(objectid); ob.deleteObject(); return RedirectToAction("Index", "PollObject", new { pollid = pollid, pollname = ViewData["pollname"] }); }