protected void AgregarUsuario(object sender, EventArgs e) { Boolean success = false; if (validarCampos()) { success = RegistroDAO.registrarUsuario(Name.Text, Phone.Text, Email.Text, Password.Text); if (success) { cleanFields(); ScriptManager.RegisterStartupScript(this, GetType(), "Información", "alert('Registro realizado con éxito.');", true); GridView1.DataBind(); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "Error", "alert('Ha ocurrido un error - Intente de nuevo.');", true); } }
protected void CreateUser_Click(object sender, EventArgs e) { //ClientScript.RegisterStartupScript([GetType](), "alert", (Convert.ToString("alert('") & message) + "');", True) Boolean success = false; if (validarCampos()) { success = RegistroDAO.registrarUsuario(Name.Text, Phone.Text, Email.Text, Password.Text); if (success) { cleanFields(); ScriptManager.RegisterStartupScript(this, GetType(), "Información", "alert('Registro realizado con éxito.');", true); Response.Redirect("/Account/Login"); } } else { //mensaje de que ingrese informacion correcta } }