public JsonResult GetUserProfile(string username) { Dictionary <string, object> response = new Dictionary <string, object>(); DataTable dt = new DataTable(); dt = UserModels.GetUserProfile(username); foreach (DataRow dr in dt.Rows) { response.Add("Username", dr["UserName"].ToString()); response.Add("FirstName", dr["FirstName"].ToString()); response.Add("LastName", dr["LastName"].ToString()); response.Add("MiddleName", dr["MiddleName"].ToString()); response.Add("Password", dr["Password"].ToString()); response.Add("Email", dr["Email"].ToString()); response.Add("UserModeDesc", dr["UserModeDesc"].ToString()); } return(Json(response, JsonRequestBehavior.AllowGet)); }