|
-
Jul 27th, 2007, 03:13 PM
#1
Thread Starter
Lively Member
Validator help
I have a required field validator that i set to validate a textbox. Even when the text box is empty the accept button code still executes.. is this suppost to happen?
-
Jul 27th, 2007, 03:22 PM
#2
Re: Validator help
In the button_Click event, add this:
Code:
If Page.IsValid Then
'whatever code you have here
End If
-
Jul 27th, 2007, 03:25 PM
#3
Hyperactive Member
Re: Validator help
also, if you put a <asp:ValidationSummary> on the page then it should also be able to stop it with Javascript on the client side... but good practice is to also do what timeshifter has pointed out and use the Page.IsValid to also get it validated on the server side.
If this post helps, please RATE MY POST!
Using Visual Studio 2005 SE
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|