[Mono-dev] BUG? asp:Button attribute CausesValidation="false" not working with RequiredValidators.

Gregory Cook 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.

Thanks,

-- 
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
page. 

Steps to reproduce the problem:
1. Create a ASP.NET form  include a textbox, RequiredValidator, and two
buttons.
2. Set CausesValidation attribute to "true" on one but and "false" on the
other button.
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.

Actual Results:

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.


Expected Results:

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.


Additional Information:
See the problem online at : http://65.12.160.30: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://65.12.160.30:8080/Dept.aspx,
this is the behavior that should have occurred when you clicked cancel.
The "Cancel" button at http://65.12.160.30:8080/DeptEdit.aspx behaves as
expected and this page does not contain a R-quiredValidator.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051013/5e6da764/attachment.html 


More information about the Mono-devel-list mailing list