Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3456104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:41:43+00:00 2026-05-18T09:41:43+00:00

Hi I am working on a custom form field validator, it seems like the

  • 0

Hi I am working on a custom form field validator, it seems like the custom validator is working by not allowing it to continue to the next page, but it doesn’t update the Validation Summary nor does it display the asterisk and the labels that i’ve made visable. I also have other validators like RequiredFieldValidator on the same field. My ValidationGroup is set, as is the Text and IsValid. I even wrote and set a dummy client side validation method in javascript as some workarounds suggests.

here is the validation summary code in asp.net

<asp:ValidationSummary ID="ValidatorSummary" runat="server" ValidationGroup="Step2" />

here is the custom validator and the required field one

<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 is the custom validation method in the code behind

protected void AddressVerification_ServerValidate(object sender, ServerValidateEventArgs e)
{
//lets just say it doesn't validate and sets the IsValid to false
lblUspsValidatorResHomeCity.Visible = true;
lblUspsValidatorResHomeState.Visible = true;
lblUspsValidatorResHomeZip.Visible = true;
e.IsValid = false;
}

please advise, thanks.

EDIT:
Answered – as bitxwise mentioned. the validation summary should be placed inside an update panel as well. Thanks!

Like so:

<asp:UpdatePanel ID="UpdatePanelValidationSummaryHome" ChildrenAsTriggers="false" UpdateMode="Conditional"
runat="server">
<ContentTemplate>
    <asp:ValidationSummary ID="AddressHomeValidationSummary" runat="server" ValidationGroup="AddressHomeValidationGroup"
        CssClass="errors" /> 
</ContentTemplate>

and then calling the update:

UpdatePanelValidationSummaryHome.Update();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:41:44+00:00Added an answer on May 18, 2026 at 9:41 am

    You seem to be missing ControlToValidate in your declaration of CustomValidator.

    EDIT

    If your CustomValidator aggregates multiple controls, then try this:

    ASPX

    <asp:TextBox ID="txtMyTextBox" runat="server" />
    <asp:CustomValidator ID="AddressVerification" runat="server"
        Display="Dynamic"
        ErrorMessage="Please enter a valid address."
        OnServerValidate="AddressVerification_ServerValidate"
        Text="*"
        ValidationGroup="Step2" />
    <asp:RequiredFieldValidator ID="rfvAddress" runat="server"
        ControlToValidate="txtMyTextBox"
        Display="Dynamic"
        ErrorMessage="Please enter an address"
        Text="*"
        ValidationGroup="Step2" />
    ...
    <asp:ValidationSummary ID="ValidatorSummary" runat="server"
        ValidationGroup="Step2" />
    ...
    <asp:Button ID="btnCheckAddresses" runat="server"
        CausesValidation="true"
        Text="Check Addresses"
        ValidationGroup="Step2" />
    

    CS

    protected void AddressVerification_ServerValidate(object source, ServerValidateEventArgs args) {
        args.IsValid = !string.IsNullOrEmpty(txtMyTextBox.Text) && !txtMyTextBox.Text.Contains(' ');
    }
    

    Note that the validation group of the control invoking the post back has CausesValidation="true" and has the same ValidationGroup as the validators.

    EDIT 2

    If your postback control was in the UpdatePanel but the ValidationSummary was not, then the partial postback would not have refreshed the ValidationSummary. Once you removed the postback control from the UpdatePanel, I imagine it would then generate a full postback, which would refresh your ValidationSummary.

    I don’t know what else is in your UpdatePanel, but many people report having issues with their validators being in UpdatePanel‘s.

    Check out MSDN,

    When you use the ValidationSummary
    control inside an UpdatePanel control,
    make sure that the validator control
    and the control it is associated with
    are in the same panel. For more
    information about using the
    UpdatePanel control for partial-page
    updates, see Partial-Page Rendering
    Overview.

    as well as this MSDN blog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project in C# w/ XNA, and I want to reorganize
I have a script that appends some rows to a table. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.