I have an asp.net page with multiple validation summaries setup with ShowMessageBox="True"
and several validators. I have run into a situation where when validation fails the validation summary displays correctly but then the next click that would normally trigger a postback of the page does not trigger a postback. So the steps look like this:
- Click button that triggers validation.
- Validation fails and a messagebox with the failure message is displayed.
- Click a different button which does not validate but should trigger a postback nothing happens
- Click same button as step 3 again postback happens as expected.
What could cause this behavior?
EDIT: The validation was being done in the following manner. In the asp page:
<asp:Button runat="server" id="btn" onClientClick="return DoValidation();" />
In the javascript:
function DoValidation() {
if (!Page_ClientValidate('group1'))
return false;
if (!Page_ClientValidate('group2'))
return false;
return true;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…