public ActionResult BatchActiveCheck() { try { db.ActivateBatch(); ViewBag.Title = "done"; Response.Write("<script>console.log('Data has been saved to db');</script>"); return(RedirectToAction("Index", "Home")); //return RedirectToAction("Index"); } catch (Exception ex) { ViewBag.Error = ex.InnerException.Message; return(View("shit")); } }