public JsonResult TakeSession(string userId) { // string userId = (System.Web.HttpContext.Current.Request != null && System.Web.HttpContext.Current.Request.Form["UserId"]!= null) ? System.Web.HttpContext.Current.Request.Form["UserId"]:"" ; repos = new TDAssetRespository(); if (System.Web.HttpContext.Current.Session["UserPermission"] == null && userId != "") { userProfile = repos.GetPermission(userId); System.Web.HttpContext.Current.Session.Add("UserPermission", userProfile); } else { userProfile = (UserProFile)System.Web.HttpContext.Current.Session["UserPermission"]; } return(Json(userProfile)); }