Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating entry in a textbox
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01026847
Message ID:
01026868
Views:
24
>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!”
		// Put your code here	
        }
}
Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform