protected void btnAdd_Click(object sender, EventArgs e) { Page.Validate("Add"); if (Page.IsValid) { string userName = func.EncodeTo64(txtUserName.Text); string pass = func.EncodeTo64(txtNewPass.Text); //getRole getRole(); if (func.ktraUser(userName) == true) { lbMess.Visible = true; } else { try { lbMess.Visible = false; //insert func.addNewMember(userName, pass, txtName.Text, ddlRole.SelectedValue); //load gridview user getAllUser(); decodeUserName(); // CloseDialog("newPerson"); upGrid.Update(); // Response.Write("<script>alert('Thêm thành công')</script>"); } catch (Exception) { // CloseDialog("newPerson"); Response.Write("<script>alert('Thêm không thành công. Thử lại sau')</script>"); } } } }