protected void bmButton_Click(object sender, EventArgs e) { Materiales material = new Materiales(); int id = 0; int.TryParse(idmTextBox.Text, out id); if (id > 0) { if (material.buscar(id)) { DevolverDatos(material); } else { Response.Write("<script>alert('No Existe Material ID!!')</script>"); } } }