We ran into what sounds like the exact same problem, and I came up with a one-line javascript 'hack' that works around the issue.
Our situation sounds identical:
- We have Telerik Ajax controls on the page
- There is a button with CausesValidation="false".
- The button doesn't do any AJAX calls. It just does a normal postback.
- The button has a client-side onclick event to popup up a confirm box and return true if OK is clicked, which should allow postback through.
When there is a validation error on the page, the first click of the button pops open the confirmation box, you click OK, and nothing happens; Upon second click, the confirmation pops up again, you click OK, and this time the postback goes through (as it should've the first time).
After stepping into the ASP.NET javascript Validation functions, I could see that the Page_BlockSubmit variable was being set to "True" somehow the first time, which would cause it to disallow the postback. This shouldn't happen when CausesValidation is set to "false". I didn't have time to fully investigate to see how/why the state of things were getting messed up. It almost seems like a bug in the ASP.NET javascript validation functions.
Anyway, my workaround was to just set ASP.NET's "Page_ValidationActive" javascript variable to false when the user chooses OK to the the confirmation. This disables client-side validation so that the postback is guaranteed to go through. You could probably alternatively set Page_BlockSubmit = false. The javascript validation variables automatically get reset when the page reloads, so this little hack shouldn't cause any other weird side effects.
Example:
// javascript on page:
function DoConfirmation()
{
var proceed = confirm('Some question?');
if (proceed)
{
// This is the one-line hack to fix ASP.NET client-side validation bug.
// It disables ASP.NET's client side validation in order to allow the
// the postback to go through.
Page_ValidationActive = false;
}
return proceed;
}
// ASPX button
<asp:Button Id="btnDoSomething" OnClick="btnDoSomething_Click" Text="Do Something" CausesValidation="False" runat="Server" />
// ASPX C# code-behind
btnDoSomething.Attributes.Add("onclick", "return DoConfirmation();");
Hope this helps someone :)