[Mono-dev] BUG? asp:Button attribute CausesValidation="false" not working with RequiredValidators.
monodev at birdsnestsoftware.net
Thu Oct 13 12:41:08 EDT 2005
I submitted a bug report #76429. But if this is just something I am
doing wrong any help is appreciated.
Gregory A. Cook
Principal, Galexan LLC
Email: gregory.cook at galexan.com
Bug Report #76429:
Description of Problem:
On an ASP.NET form with multiple buttons, and RequiredValidators, if you
set a button to CausesValidation="false" validation is not run but the
button does not generate a submit anymore. When omitted, the
CausesValidation attribute defaults to try and causes validation. This is
a problem if you want to cancel validation and simply navigate to another
Steps to reproduce the problem:
1. Create a ASP.NET form include a textbox, RequiredValidator, and two
2. Set CausesValidation attribute to "true" on one but and "false" on the
3. Create and add (+= new System.EventHandler) event handlers for both
buttons "Click" events in a code behind.
4. For the button with CausesValidation="false" code the eventhandler to
simply Redirect.Response to another page.
Pressing the button with CausesValidation="true" triggers validation. Once
validation conditions have been met a submit is performed as aspected.
Pressing the button with CausesValidation="false" does nothing.
Pressing the button with CausesValidation="false" should result in the
browser navigating to the page specified in the Redirect.Response call in
this buttons Click callback event.
How often does this happen? All the time.
See the problem online at : http://188.8.131.52:8080/Dept.aspx
Press the "Add Dept." button.
Now try to click the Add button without entering the Department number and
name fields, validation occurs as expected.
Click "Cancel", nothing happens.
Click "Back", page is redirected to http://184.108.40.206:8080/Dept.aspx,
this is the behavior that should have occurred when you clicked cancel.
The "Cancel" button at http://220.127.116.11:8080/DeptEdit.aspx behaves as
expected and this page does not contain a R-quiredValidator.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list