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 6177117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:12:59+00:00 2026-05-24T00:12:59+00:00

So I have an ASP.NET/VB web application in which I’m using both RequiredFieldValidators and

  • 0

So I have an ASP.NET/VB web application in which I’m using both RequiredFieldValidators and CustomValidators. However, I have been having some major issues with all the validation. When you click a “Next” button to go to the next page of the form without filling in the required fields, all the RequiredFieldValidators fire and the error messages show up, but after a moment it still goes to the next page. Sometimes after changing what seem to be unrelated parts of the code, it starts working again, and works for awhile until I change something else. The CustomValidators are even more inconsistent, sometimes working, sometimes firing but not preventing the user from moving to the next page, and sometimes not working at all, but only stop/start working when I change code that seems like it shouldn’t be effecting it. Sometimes one works and one doesn’t. What’s driving me crazy about this is it seems so random. And I can’t seem to pinpoint what changes in the code actually effect this. Does anyone have any ideas? Is there anything that would effect all the validation on a page at once? Here is some of my code, I can also post some of the code behind if necessary.

Required Field Validator:

<asp:RequiredFieldValidator ID="rfvFirstName" ControlToValidate="txtFirstName" runat="server"SetFocusOnError="true" ErrorMessage="Required"></asp:RequiredFieldValidator>

Custom Validators:

<asp:CustomValidator ID="cvRequired" runat="server" ControlToValidate="txtCourseNum" Enabled="true" ErrorMessage=""></asp:CustomValidator>
<asp:CustomValidator ID="cvDuplicate" runat="server" ControlToValidate="txtCoursePrefix" Enabled="true" ErrorMessage=""></asp:CustomValidator>

Next button:

<asp:Button ID="btnNextA" runat="server" Text="Next" OnClick="btnNext_Click" UseSubmitBehavior="true" CausesValidation="true" />
  • 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-24T00:13:00+00:00Added an answer on May 24, 2026 at 12:13 am

    Sara, make sure the buttons that shouldn’t be validating have the CausesValidation set to false. Also if you end up posting back for validation, make sure to look at the Page.IsValid property before assuming things are valid. Validators will fire before postback events. Is your next button posting back– if so, then check for that.

    I bet if you load the page for the first time and don’t put in a value for the required field, then you will be prevented from going to the next page. But if you have a value for the required value, you will see validators fire, but you will go to the next page. The code behind for the next button should check for the Page.IsValid property.

    The reason the validation is confusing is that some validators will by default occur client side (required field validators for instance) while some will occur server side (like custom validators that have server side methods subscribed to their events). If a client side validator fails, you’ll never make it to the server. Also, if the client side validators pass your server side validators will run, but…. and this is the tricky part, your post back handler will fire after the validator fires. So if you redirect in your post back handler (let’s say the post back was caused by a button click) then even if your server side validator fails, you will be redirected so your validator appears not to be working. It probably worked, but you might not have checked the Page.IsValid property.

    Again it’s important to note that the order is:

    • client side validation,
    • server side validation,
    • then your post back event

    I wouldn’t swear on a stack of bibles (because I don’t have a stack of bibles), but what you see as inconsistent behavior could very well be that you are not actually performing things in the same order. If you put nothing in the required fields, then you should never be posting back. If you put something in the required fields and one of your server side validators fails, then you’ll post back, but if you don’t test for Page.IsValid it will appear as if validator is not working.
    event handlers.

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

Sidebar

Related Questions

I have an ASP.net web service that I'm using for a web application which
I have a location using our ASP.NET 4.0 web application which was running fine
I have a asp.net web application which has a number of versions deployed on
I have an ASP.NET web application which does the following: Reads an Excel file.
We have an intranet asp.net web application which uses the OOTB ASP.net membership and
I have created a Web Application in asp.net 2.0. which is working fine on
Suppose you have two seperate ASP.NET Web Application projects that both need to use
I have an ASP .NET web application which uses Forms Authentication. Let's call this
I have a ASP.NET web application which has more than 100 pages. Each page
I have an ASP.NET web application which contains a DLL in the /bin folder

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.