public ActionResult Index() { var loginId = User.Identity.Name; //If user Id has main name prefix var domainIdx = loginId.IndexOf("\\") + 1; if (domainIdx != -1) { loginId = loginId.Substring(domainIdx); } AdUserModel userDetails = ActiveDirectoryHelper.GetUserDetailsFromLoginId(loginId); return(View(userDetails)); }
public JsonResult GetUserByUserId(string loginId) { AdUserModel userDetails = ActiveDirectoryHelper.GetUserDetailsFromLoginId(loginId); return(Json(userDetails, JsonRequestBehavior.AllowGet)); }