I've seen many a forum and blog entries that look like the title of this entry. I was frantically trying to find the solution for this a few hours ago and found a lot of questions of the same type, most of them abruptly ending into nothing. No solution, only the questions. What was I to do? Debug!

The problem was that buttons with __doPostBack seemed to work and those with WebForm_DoPostBackWithOptions did not. I pressed them and nothing happened.

Debugging the hell out of the two javascript functions (both used by NET 2.0, on who knows what conditions) I realized that the problem was not in the javascript functions! The problem was a false one.

The real problem is in the validators. If you have a validator on a field and the field has some wrong values in it and both field and validators are hidden, the submit will not work and you will not see what the problem is. Let me make this simple: if you have problems with submit buttons that seem not to work, check your validators!

Now, why the field was hidden and its values filled and the validator enabled is a problem, but that I can fix easily. The "Oh, I am so stupid" phenomenon probably stopped a lot of people posting the solution after they found it.

Comments

Siderite

<p>Thank you for clarifying your problem and solution.</p>

Siderite

mfo

<p>Thanks!</p><p>If you have multiple buttons and only <b>one</b> should cause the validation, then specify <code>ValidationGroup</code> property for the validators and for the button with the same group value provided.</p><p>More Info: <br><a href="https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.validationgroup?view=netframework-4.8" rel="nofollow noopener" title="https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.validationgroup?view=netframework-4.8">ValidationGroup property for Button</a>.<br><a href="https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.basevalidator.validationgroup?view=netframework-4.8" rel="nofollow noopener" title="https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.basevalidator.validationgroup?view=netframework-4.8">ValidationGroup property for Validator</a></p><p>Hope this might be helpful for someone.</p>

mfo

Micro-BIOS

<p>Yay! 2019 and this is still useful! Thanks you guy.</p>

Micro-BIOS

Custos

<p>Your post is still saving asses almost a decade after it was posted.</p>

Custos

Custos

Your post is still saving asses almost a decade after it was posted.

Custos

Rajiv

<p>Thanks for sharing it. I wasted almost two entire days looking for a solution for this.</p>

Rajiv

Rajiv

Thanks for sharing it. I wasted almost two entire days looking for a solution for this.

Rajiv

Anonymous

<p>Thanks <br>At last find Solution on Your blog after 2 hours searching<br>God Bless You <br><br><br>Imran Ullah Khan Pakistan</p>

Anonymous

Anonymous

Thanks <br>At last find Solution on Your blog after 2 hours searching<br>God Bless You <br><br><br>Imran Ullah Khan Pakistan

Anonymous

Anonymous

<p>Man you saved me few hours of work, Thanks!!</p>

Anonymous

Anonymous

Man you saved me few hours of work, Thanks!!

Anonymous

Al

<p>At last!! Adding CausesValidation="false" to my link buttons solved my problem too.<br>Cheers.</p>

Al

Al

At last!! Adding CausesValidation=&quot;false&quot; to my link buttons solved my problem too.<br>Cheers.

Al

Tim Hong

<p>Awesome Help. Knowledge always worth to share! Thank you very much!</p>

Tim Hong

Tim Hong

Awesome Help. Knowledge always worth to share! Thank you very much!

Tim Hong

Bruno Monteiro

<p>Thank you dude.<br>Now, my buttons are CauseValidation = false.<br><br>;)</p>

Bruno Monteiro

Bruno Monteiro

Thank you dude.<br>Now, my buttons are CauseValidation = false.<br><br>;)

Bruno Monteiro

Siderite

<p>Why are you doing software development if you are not a software person?<br><br>There isn't much I can say outside of what is in the post. You should look for ASP.Net controls that end in "Validator" somewhere in the aspx, ascx or maybe instantiated in the code. A control that contains those validators or even an html container that are hidden via styling is what is wrong with your page. A validator control is always associated with an input control, like a textbox or text input or checkbox, radio button, select, etc.<br><br>To check this from the browser, rather than from within the code, use a DOM inspector (all major browsers have one included nowadays) and look for hidden container elements. Make them show (by removing the display:none style attribute) and maybe you will see the validator that is throwing the error and stopping you from doing a postback.</p>

Siderite

Siderite

Why are you doing software development if you are not a software person?<br><br>There isn&#39;t much I can say outside of what is in the post. You should look for ASP.Net controls that end in &quot;Validator&quot; somewhere in the aspx, ascx or maybe instantiated in the code. A control that contains those validators or even an html container that are hidden via styling is what is wrong with your page. A validator control is always associated with an input control, like a textbox or text input or checkbox, radio button, select, etc.<br><br>To check this from the browser, rather than from within the code, use a DOM inspector (all major browsers have one included nowadays) and look for hidden container elements. Make them show (by removing the display:none style attribute) and maybe you will see the validator that is throwing the error and stopping you from doing a postback.

Siderite

Anonymous

<p>OOOPSSS sorrryyyy!! if i was rude but was in hurry and yes i really dont get it because m not a software person as u said a software ill :P. I have to fill up a webform but the SAVE button is not active and my work is getting late day by day and i literally dont know how to resolve this problem. If u cud help me through this i'll be reallyyy thankful to you :)</p>

Anonymous

Anonymous

OOOPSSS sorrryyyy!! if i was rude but was in hurry and yes i really dont get it because m not a software person as u said a software ill :P. I have to fill up a webform but the SAVE button is not active and my work is getting late day by day and i literally dont know how to resolve this problem. If u cud help me through this i&#39;ll be reallyyy thankful to you :)

Anonymous

Siderite

<p>Dear Anonymous, I thought long and hard before answering, oscillating between swear words, insults and blaming you and your kind for all software ills to the desire to actually help you, even if you seem unable to even ask for it in a decent way. But I think the best possible answer is a classic: <a rel="nofollow">http://lmgtfy.com/?q=ASP.Net+Validator</a></p>

Siderite

Siderite

Dear Anonymous, I thought long and hard before answering, oscillating between swear words, insults and blaming you and your kind for all software ills to the desire to actually help you, even if you seem unable to even ask for it in a decent way. But I think the best possible answer is a classic: <a rel="nofollow">http://lmgtfy.com/?q=ASP.Net+Validator</a>

Siderite

Anonymous

<p>i am having the same problem and still dont get whatever u ppl are saying :( what is a validatr?? whr to find it?? where to put this causes validation thing???</p>

Anonymous

Anonymous

i am having the same problem and still dont get whatever u ppl are saying :( what is a validatr?? whr to find it?? where to put this causes validation thing???

Anonymous

Nick Pearce

<p>Still a life saver 5 years on... thank you.</p>

Nick Pearce

Nick Pearce

Still a life saver 5 years on... thank you.

Nick Pearce

Anonymous

<p>Thanks.<br>You save my day!!<br>Explained in simple terms.</p>

Anonymous

Anonymous

Thanks.<br>You save my day!!<br>Explained in simple terms.

Anonymous

Anonymous

<p>Thank you - after two hours, this fixed my issue.</p>

Anonymous

Anonymous

Thank you - after two hours, this fixed my issue.

Anonymous

Anonymous

<p>thanks, it's really helped me. great article.</p>

Anonymous

Anonymous

thanks, it&#39;s really helped me. great article.

Anonymous

Anonymous

<p>Great work! This appears to have fixed a problem with controls assigned as triggers to an update panel which randomly stop working (__postback function). <br><br>In my case, I would often leave the page and do some work, come back to the site only to find the controls no longer functioning. <br><br>I have now added causesvalidation="false" to all of my controls hooked up as triggers to an updatepanel.</p>

Anonymous

Anonymous

Great work! This appears to have fixed a problem with controls assigned as triggers to an update panel which randomly stop working (__postback function). <br><br>In my case, I would often leave the page and do some work, come back to the site only to find the controls no longer functioning. <br><br>I have now added causesvalidation=&quot;false&quot; to all of my controls hooked up as triggers to an updatepanel.

Anonymous

Anonymous

<p>Perfect, after two days of googling this was a breath of fresh air. You saved me!!!</p>

Anonymous

Anonymous

Perfect, after two days of googling this was a breath of fresh air. You saved me!!!

Anonymous

Anonymous

<p>Thank's this was what I searched for</p>

Anonymous

Anonymous

Thank&#39;s this was what I searched for

Anonymous

Padma

<p>you are doing a great things to the world of developers.thanks a lot for ur articles and solutions to bugs (especially for ajax related javascript errors hats off to you and ur talent.) very happy in greeting you. wish you all success in your endeavours.Great thanks to you</p>

Padma

Padma

you are doing a great things to the world of developers.thanks a lot for ur articles and solutions to bugs (especially for ajax related javascript errors hats off to you and ur talent.) very happy in greeting you. wish you all success in your endeavours.Great thanks to you

Padma

Scott

<p>Thanks a million! I had disabled (enabled=false) my validators in a user control. I would have never found this.</p>

Scott

Scott

Thanks a million! I had disabled (enabled=false) my validators in a user control. I would have never found this.

Scott

neeva

<p>Thankyou so much .. I was facing the same problem ..your post saved me a lot of time ..</p>

neeva

neeva

Thankyou so much .. I was facing the same problem ..your post saved me a lot of time ..

neeva

Anonymous

<p>Thanks dude, as everybody else has said, this saved me hours of useless research time that I would have spent.</p>

Anonymous

Anonymous

Thanks dude, as everybody else has said, this saved me hours of useless research time that I would have spent.

Anonymous

DJ

<p>I had the LinkButton only worked once problem. Added CausesValidation="false", now works like a charm. Thanks Rowan</p>

DJ

DJ

I had the LinkButton only worked once problem. Added CausesValidation=&quot;false&quot;, now works like a charm. Thanks Rowan

DJ

Massimo

<p>Thanks for your post!<br>I had spent a lot of time on that problem...<br>Thanks to rowan, too.. I had the same problem..<br><br>quote: " rowan said... <br>I had the same problem using LinkButtons. If you clicked on the link twice or more in IE 6 then the links would stop working.<br>I was able to fix it by adding this to the LinkButton tag:<br>CausesValidation="false" "</p>

Massimo

Massimo

Thanks for your post!<br>I had spent a lot of time on that problem...<br>Thanks to rowan, too.. I had the same problem..<br><br>quote: &quot; rowan said... <br>I had the same problem using LinkButtons. If you clicked on the link twice or more in IE 6 then the links would stop working.<br>I was able to fix it by adding this to the LinkButton tag:<br>CausesValidation=&quot;false&quot; &quot;

Massimo

Anonymous

<p>This post has just save me from pulling my hair. I had CommandField in a GridView but when you edit a press update nothing happens and have wasted a lot of hours trying to figure it out. After setting CausesValidation="false" it is working ok!!.<br>Many thanks</p>

Anonymous

Anonymous

This post has just save me from pulling my hair. I had CommandField in a GridView but when you edit a press update nothing happens and have wasted a lot of hours trying to figure it out. After setting CausesValidation=&quot;false&quot; it is working ok!!.<br>Many thanks

Anonymous

Josh Gough

<p>Thank you!! I had neglected to add a validation summary to my page so my control, which was bubbling up errors to the page had nowhere to display them. All the errors displayed inline, but clicking Submit did nothing to highlight this fact.</p>

Josh Gough

Josh Gough

Thank you!! I had neglected to add a validation summary to my page so my control, which was bubbling up errors to the page had nowhere to display them. All the errors displayed inline, but clicking Submit did nothing to highlight this fact.

Josh Gough

Siderite

<p>Ok. The solution is to find out which validator causes the problem. You should know that if you made the page and all, since you are the one putting validators there. <br><br>But let's assume that you don't know what is going on. The best solution is to see what the Page_Validators array contains (in Javascript) and what is their controltovalidate value.<br><br>Something like <b><i>javascript:alert(Page_Validators[0].controltovalidate);</i></b> in your browser address bar should do the trick to show you the control that the first validator (if any) is trying to validate. The property might be controlToValidate, I am not sure about the casing and I am too tired to test it out.</p>

Siderite

Anonymous

<p>I had the same problem with the Finish button in the Wizard. I change to using Panels instead and still had the same problem. CausesValidation=false worked for me. What's up with that? Thanks again.</p>

Anonymous

Siderite

Ok. The solution is to find out which validator causes the problem. You should know that if you made the page and all, since you are the one putting validators there. <br><br>But let&#39;s assume that you don&#39;t know what is going on. The best solution is to see what the Page_Validators array contains (in Javascript) and what is their controltovalidate value.<br><br>Something like <b><i>javascript:alert(Page_Validators[0].controltovalidate);</i></b> in your browser address bar should do the trick to show you the control that the first validator (if any) is trying to validate. The property might be controlToValidate, I am not sure about the casing and I am too tired to test it out.

Siderite

Anonymous

I had the same problem with the Finish button in the Wizard. I change to using Panels instead and still had the same problem. CausesValidation=false worked for me. What&#39;s up with that? Thanks again.

Anonymous

Anonymous

<p>You're a life saver, I've been racking my brain (and the net) for hours trying to figure it out... Damn Microsoft they couldn't have made this one easy...</p>

Anonymous

Anonymous

You&#39;re a life saver, I&#39;ve been racking my brain (and the net) for hours trying to figure it out... Damn Microsoft they couldn&#39;t have made this one easy...

Anonymous

takejiro

<p>thank God for this!! i've been googling for hours on how to solve this. CausesValidation=false did it for me. life saver!!</p>

takejiro

takejiro

thank God for this!! i&#39;ve been googling for hours on how to solve this. CausesValidation=false did it for me. life saver!!

takejiro

rowan

<p>I had the same problem using LinkButtons. If you clicked on the link twice or more in IE 6 then the links would stop working.<br>I was able to fix it by adding this to the LinkButton tag:<br>CausesValidation="false"</p>

rowan

rowan

I had the same problem using LinkButtons. If you clicked on the link twice or more in IE 6 then the links would stop working.<br>I was able to fix it by adding this to the LinkButton tag:<br>CausesValidation=&quot;false&quot;

rowan

Anonymous

<p>Thanks, you really saved my bacon with that one!</p>

Anonymous

Anonymous

Thanks, you really saved my bacon with that one!

Anonymous

Post a comment