我已经弄明白了。这是我所做的,以防有人在这个问题上绊倒。
function ValidateSection3() {
var isSection1Validated = Page_ClientValidate("vgSection1");
var isSection2Validated = Page_ClientValidate("vgSection2");
var isSection3Validated = Page_ClientValidate("vgSection3");
for (i = 0; i < Page_ValidationSummaries.length; i++) {
if (Page_ValidationSummaries[i].validationGroup.toString() == "vgSection1") {
if (!isSection1Validated) {
Page_ValidationSummaries[i].style.display = "";
}
}
else if (Page_ValidationSummaries[i].validationGroup.toString() == "vgSection2") {
if (!isSection2Validated) {
Page_ValidationSummaries[i].style.display = "";
}
}
else if (Page_ValidationSummaries[i].validationGroup.toString() == "vgSection3") {
if (!isSection3Validated) {
Page_ValidationSummaries[i].style.display = "";
}
}
}
return isSection1Validated && isSection2Validated && isSection3Validated;
}