public ActionResult MemberAdDelete(int id) { var session = HttpContext.Session; if (session != null) { HttpContext.Session.TryGetValue("token", out var result); if (result != null) { TempData["isLoggedIn"] = HttpContext.Session.GetString("token"); TempData["memberID"] = HttpContext.Session.GetString("memberID"); Tbl_Ad ad = _AdService.Get(id); _AdService.Delete(ad); return(RedirectToAction("MemberAdListCrud", "MemberPage")); } } return(RedirectToAction("Index", "GeneralPage")); }
public JsonResult MemberAdDelete(int id) { var session = HttpContext.Session; if (session != null) { HttpContext.Session.TryGetValue("token", out var result); if (result != null) { TempData["isLoggedIn"] = HttpContext.Session.GetString("token"); TempData["memberID"] = HttpContext.Session.GetString("memberID"); Tbl_Ad ad = _AdService.Get(id); _AdService.Delete(ad); return(Json(Ok())); //return Json("MemberAdListCrud", "MemberPage"); } } return(Json("Giriş Yapın")); }