Hey. I am working on a special form field validation tool, it seems that the custom validator works by not allowing it to go to the next page, but it does not update the validation summary and does not display an asterisk and shortcuts that I made visible. I also have other validators, such as RequiredFieldValidator in the same field. My ValidationGroup is installed, as are Text and IsValid. I even wrote and installed client-side authentication method in javascript, as some workarounds suggest.
here is the summary verification code in asp.net
<asp:ValidationSummary ID="ValidatorSummary" runat="server" ValidationGroup="Step2" />
here is a custom validator and a required field 1
<asp:CustomValidator ID="AddressVerification" runat="server" ErrorMessage="Please enter a valid address." Display="Dynamic" ValidationGroup="Step2" OnServerValidate="AddressVerification_ServerValidate" ClientValidationFunction="CustomValidatorDummy" Text="*" Enabled="true" EnableClientScript="true"></asp:CustomValidator>
<asp:RequiredFieldValidator ID="RFValidatorHomeAddress" runat="server" ErrorMessage="Please enter home address." Text="*" Display="Dynamic" ValidationGroup="Step2" ControlToValidate="txtHomeAddress"></asp:RequiredFieldValidator>
here a special verification method is used in the code <
protected void AddressVerification_ServerValidate(object sender, ServerValidateEventArgs e)
{
lblUspsValidatorResHomeCity.Visible = true;
lblUspsValidatorResHomeState.Visible = true;
lblUspsValidatorResHomeZip.Visible = true;
e.IsValid = false;
}
please advise, thanks.
EDIT:
- . . !
:
<asp:UpdatePanel ID="UpdatePanelValidationSummaryHome" ChildrenAsTriggers="false" UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<asp:ValidationSummary ID="AddressHomeValidationSummary" runat="server" ValidationGroup="AddressHomeValidationGroup"
CssClass="errors" />
</ContentTemplate>
:
UpdatePanelValidationSummaryHome.Update();