protected void cvCode_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = true; UnitsGateway unitsGateway = new UnitsGateway(null); int unitId = int.Parse(hdfUnitId.Value); if (unitsGateway.IsUnitCodeInUse(args.Value.Trim(), unitId)) { args.IsValid = false; } }
protected void cvCode_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = true; UnitsGateway unitsGateway = new UnitsGateway(null); if (unitsGateway.IsUnitCodeInUse(tbxCode.Text)) { args.IsValid = false; } }