public ActionResult Index() { StudentViewModel st = stb.GetStudentbyEmailId(Session["emailid"].ToString()); Session.Add("studentid", st.StudentId); if (st.StudentId > 0) { ViewBag.SaveText = "Update"; Session.Add("action", "Update"); } else { ViewBag.SaveText = "Save"; Session.Add("action", "Save"); } return(View(st)); }