Monday, October 6, 2008

Programatically add to the validation summary VB

Sub checkforASF(ByVal sender As Object, ByVal ByVal e As System.EventArgs)

Dim asfvalidator As New CustomValidator

If sender.text = "" Then
asfvalidator.IsValid = False
asfvalidator.ErrorMessage = "Please enter an ASF value, or 0 for none."
asfvalidator.ID = "checkforASFvalidator"
Validators.Add(asfvalidator)
Pr_Ch_ASF.BackColor = System.Drawing.Color.Red
focus_on_nextfield(Pr_Ch_ASF)

Else
asfvalidator.IsValid = True
Pr_Ch_ASF.BackColor = System.Drawing.Color.Transparent
SFDB_Last_Changed_Date("checkforASF")
End If
End Sub

No comments:

Post a Comment