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

  • SEARCH
  • Home
  • 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 7782333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:30:35+00:00 2026-06-01T19:30:35+00:00

I have a rather large ASPX form with lots of textboxes and drop down

  • 0

I have a rather large ASPX form with lots of textboxes and drop down lists to fill in. Most of the textboxes have RequiredFieldValidator controls and these work just fine.

However, I have 3 textboxes for Home, Mobile and Work Telephone numbers. Each textbox is optional but if it is filled in, then the value must be numeric. I don’t need to validate the format of the phone number at this point, only ensure that it is numeric.

The client side code for one of the fields looks like so:

<asp:Label ID="lblWorkPhone" runat="server" AssociatedControlID="txtWorkPhone" Text="<%$ Resources: Registration, WorkPhone %>" /><br />
<asp:TextBox ID="txtWorkPhone" runat="server" />
<asp:CustomValidator ID="validateWorkPhone" runat="server" 
                            ValidationGroup="reg" ControlToValidate="txtWorkPhone" ForeColor="Red" 
                            ErrorMessage="<%$ Resources: Registration, HomePhoneNumber %>" 
                            Text="<%$ Resources: Registration, RequireMessage %>" 
                            onservervalidate="validateWorkPhone_ServerValidate" />

The server side validation method is here :

protected void validateWorkPhone_ServerValidate(object source, ServerValidateEventArgs args)
{
    long temp = 0;

    long.TryParse(txtWorkPhone.Text, out temp);

    if (temp == 0)
    {
        args.IsValid = false;
        validateWorkPhone.IsValid = true;
    }
    else
    {
        args.IsValid = true;
        validateWorkPhone.IsValid = false;
    }
}

As far as I can tell the server side validation method is not firing at all. All the other validation controls on the page do seem to work fine.

Can anybody help?

  • 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-06-01T19:30:36+00:00Added an answer on June 1, 2026 at 7:30 pm

    Are the client-side validators (such as the RequiredFieldValidators) valid? The server-side validators only fire when all the client-side ones are valid.

    EDIT
    Most validators, such as RequiredFieldValidator or RegularExpressionValidator, perform the validation both client-side and server side. When the client-side validation fails, the submit is cancelled so a server-side-only validation doesn’t fire.

    For a CustomValidator you will have to add a client-side validation explicitly, if you want that.

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

Sidebar

Related Questions

I have a rather large project made up of lots of...projects, each with their
I have rather large project that uses ICU regex classes. Basically it might run
I have a rather large SQL file which starts with the byte order marker
I have a rather large diff of 2 GIT branches and would like to
We have a rather large and complex application written in Java which is running
I have a rather large database that has alot of decimal columns in alot
I have a rather large amount of data (100 MB or so), that I
I have a rather large and complex game in C#, and in it are
I have a rather large application that has literally a hundred DDLs with Yes
I have a rather large project whose Installer is written using NSIS. My problem

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.