protected void LvRoleItems_OnItemCommand(object sender, ListViewCommandEventArgs e) { UM_UC_RoleAdd roleAdd = new UM_UC_RoleAdd(); HtmlTableRow SelectedRow; if (e.Item.DisplayIndex % 2 == 0) //even { SelectedRow = e.Item.FindControl("trItemTemplate") as HtmlTableRow; } else //odd { SelectedRow = e.Item.FindControl("trAltItemTemplate") as HtmlTableRow; } SelectedRow.BgColor = "Red"; if (String.Equals(e.CommandName, "Delete")) { if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "delete")) { LoggedIn master = (LoggedIn)this.Master; master.ShowMessage("You are not authorised to perform this function. Please contact system administrator.", false); return; } RoleBE role = new RoleBE(); string[] arg = new string[3]; arg = e.CommandArgument.ToString().Split(','); hdnRoleId.Value = arg[0].ToString(); role.RoleShortDesc = arg[1].ToString(); role.RoleLongDesc = arg[2].ToString(); RoleShortDescText.Text = role.RoleShortDesc; RoleLongDescText.Text = role.RoleLongDesc; mpe_DeleteRole.Show(); } if (String.Equals(e.CommandName, "Edit")) { if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "edit")) { LoggedIn master = (LoggedIn)this.Master; master.ShowMessage("You are not authorised to perform this function. Please contact system administrator.", false); return; } RoleBE role = new RoleBE(); string[] arg = new string[5]; arg = e.CommandArgument.ToString().Split(','); hdnRoleUpdateId.Value = arg[0].ToString(); role.RoleShortDesc = arg[1].ToString(); role.RoleLongDesc = arg[2].ToString(); string lastModifiedBy = arg[3].ToString(); string lastModifiedAt = arg[4].ToString(); UCRoleAddList.RoleId = Convert.ToInt32(hdnRoleUpdateId.Value); UCRoleAddList.ShortDesc = role.RoleShortDesc; UCRoleAddList.LongDesc = role.RoleLongDesc; UCRoleAddList.LastModifiedBy = lastModifiedBy; UCRoleAddList.LastModifiedAt = lastModifiedAt; mpe_EditRole.Show(); } }