private void BindingMenuView(SPWeb spWeb, IEnumerable <IGrouping <string, PermissionGroup> > groupPermissionGroupList) { IList <RootMenu> RootMenuList = new List <RootMenu>(); var currentLang = Context.Session != null ? Context.Session[STR_KEY_NAME].ToString() : ""; var subSection = Request.Params[SUB_SECTION_PARAM]; subSection = subSection != null?string.Format("/{0}/", subSection) : null; var currentURL = Request.CurrentExecutionFilePath; string webUrl = spWeb.Url; foreach (var permissionGroup in groupPermissionGroupList) { var RootMenu = new RootMenu(); RootMenu.Name = permissionGroup.Key; if (RootMenu.Name.ToLower() == "timesheet") { RootMenu.Name = DEFAULT_LANG == currentLang ? RootMenu.Name : "Chấm công"; } else if (RootMenu.Name.ToLower() == "management") { RootMenu.Name = DEFAULT_LANG == currentLang ? RootMenu.Name : "Quản lý"; } foreach (var page in permissionGroup.ToList <PermissionGroup>()) { var fulUrl = webUrl + page.PageName; page.Name = DEFAULT_LANG == currentLang ? page.Name : page.VietNameseName; page.VietNameseName = ""; RootMenu.PermissionGroups.Add(page); if (fulUrl.Contains(currentURL) || (subSection != null && fulUrl.Contains(subSection))) { //set temp value of actived item to VietNameseName page.VietNameseName = "selected ms-core-listMenu-selected"; } } RootMenuList.Add(RootMenu); } RootItem.DataSource = RootMenuList; RootItem.DataBind(); }