ASP.NET Submit but don't validate?
I have a form that looks like this :
[ enterdata: [______] ; more data: [_____] ; (SUBMITBUTTON) ]
[ Filter: [_______] ; (SUBMITBUTTON) ]
The top half has validators. I want to be able to type into the Filter textbox and press enter to fire it's submit button - but when I press enter, it validates the top half of the form also.
How do I do this? I have all the controls in the top half on one Validation开发者_StackOverflowGroup, and all of the controls on the bottom half in another.
By "all the controls", do you include the buttons? Buttons and validators need to have separate validation groups assigned in order to be mutually exclusive.
Please validate that both submit buttons have a validation group assigned, and that all validators have a validation group assigned corresponding to the button that should cause that validator to validate.
As an alternative, you can set CausesValidation
to false on the filter button if there needs be no validation performed at all.
精彩评论