protected void GetUserGroupById(string userGroupId) { UserGroupBLL userGroup = new UserGroupBLL(); try { DataTable dt = userGroup.GetUserGroupById(userGroupId); if (dt.Rows.Count > 0) { userGroupNameForUpdateHiddenField.Value = userGroupNameTextBox.Text = dt.Rows[0]["UserGroupName"].ToString(); descriptionTextBox.Text = dt.Rows[0]["Description"].ToString(); } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = ""; } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }