Addie,
Thanks for your reply. I did try using the regular expression as well, but I get the exact same result.
My gridview loads based on the two parameters from the form. As soon as the form loads, information is filled in the text boxes, coming from my database. Based on the info in the textboxes, the gridview loads right away without any submits. Then if a user changes the date on the form, the gridview gets automatically reloaded since the info in the textbox has changed.
Here is the problem - when I change a date in the textbox and hit Enter on the keyboard, the validation activates and prevents the gridview from loading (which is right). However, as soon as I click out or tab out of the textbox, the gridview attempts to load, but then I get the page error.
What I need is a function in the code-behind so that the dataset for the gridview's datasource does not load if the validation has not passed, like this:
Protected Sub dsHours_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles dsHours.DataBinding
If CompletionDateCompareValidator.IsValid Then
GridViewHours.DataBind()
End If
End Sub
However, this function doesn't seem to help, but I think I'm on the right track though. Any thoughts?