/// <summary> /// Método usado para verificar se já existe a matrícula passada. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="args">The <see cref="System.Web.UI.WebControls.ServerValidateEventArgs"/> instance containing the event data.</param> protected void CustomValidatorMatricula_ServerValidate(object source, ServerValidateEventArgs args) { Adaptador adpt = new Adaptador(); if (!adpt.existeMatricula(args.Value)) { args.IsValid = false; } else { args.IsValid = true; } }