public ActionResult StartForm(StartFormViewModel st) { if (!HttpContext.User.Identity.IsAuthenticated) { var script = "window.location ='" + Url.Action("Login", "Account") + "' ;"; return(JavaScript(script)); } st.UserId = User.Identity.GetUserId(); _myBll.AddApplicationForAny(st); return(PartialView("TestView", st.Class)); }