jmc: Thanks for the help looking into this. I then added the following event handler: VB Code: Private Sub TextBox1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating If Me.TextBox1.Text = String.Empty Then Originally Posted by jmcilhinney Hmmm... Mar 13, 2008 08:01 AM|gyana.ojha|LINK instead of Html Button try it with asp:button Mark As Answer if it helps Thanks & Regard Gyana Ojha Reply Freakyuno Contributor 2800 Points 1941 Posts Source
Powered by Blogger. I think you are right about causesvalidation being meant for dialogues as all the evidence points to that, but the msdn material would indicate otherwise (which is why I pursued this Hi jmc, thanks for the help. Mar 14, 2008 01:05 AM|fluxray|LINK Hi all thanks for the discussion. More about the author
I know there are quite some other alternatives to achieve the same objective to disable the validation. What I have found to work is in the close if I loop over all the controls and set CausesValidation=false then it works as expected by closing the form despite any Bryan Sampica My Blog Reply Deleo Participant 1131 Points 386 Posts Re: TextBox causesvalidation = false not working? Please use due diligence before making use of the info published here.
Reply gyana.ojha Member 372 Points 371 Posts Re: TextBox causesvalidation = false not working? Causesvalidation True Not Working I should have taken my testing a step further. What you've described sounds reasonable, but there's probably something that's being over looked (and I'll bet it's something simple and stupid... http://forums.asp.net/t/1162848.aspx?Button+CausesValidation+not+working If the user clicks the cancel button for the second time it would trigger postback.
You are using one incorrectly. 1. Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are But one of my other buttons ends up being the validator some how. I'll take a look at it and see what needs to be done.
I don't think any ethical professional would like to get his name associated with piracy.Blog post's © Sandeep P.R Awesome Inc. http://sandblogaspnet.blogspot.com/2009/12/weird-causesvalidation-not-working.html so when i type something in the MasterPage TextBox and nothing in ContentPage textboxes, press Enter, validation in ContentPage still ocures. Causesvalidation False Still Validating If the user clicks the cancel button immediately after clicking the submit button and there are any validation errors displayed through the validation controls then the cancel button would not postback. Asp.net Causesvalidation True Not Working C#VB Copy <%@ Page Language="C#" AutoEventWireup="True" %>