>I have an ASP.NET page where entry in one of the text boxes have to be validated against a database. I put the validation code in the OnTextChanged method on the textbox. It works except if a user enters anything in the textbox and then immediately clicks on the Submit button. Then, the OnTextChanged method does not fire and entry is not validated.
>
>Any suggestions to why the OnTextChanged does not fire or what other method I could use for the job?
>
>Thank you for any suggestions.
Dmitry;
Use an Input Validation Control
For VB.NET
Sub cmdSubmit_Click(s As Object, e As EventArgs)
If Page.IsValid Then
Message.Text “Looks good!”
‘ Put your code here
End If
End Sub
C#
Private void cmdSubmit_Click(object s, Systems.EventArgs e)
{
if (Page.IsValid)
{
Message.Text “Looks good!”
}
}
Tom