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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:44:38+00:00 2026-05-25T09:44:38+00:00

I have an asp.net mvc 3 application, and am now trying to add some

  • 0

I have an asp.net mvc 3 application, and am now trying to add some validation to it. I am testing with a clean solution. I don’t want the validation to occur on the client side (for now), so I have disabled this in Web.config:

<add key="ClientValidationEnabled" value="false"/>

I have a simple class which is implementing IValidatableObject, and I want to use the Validate function for the validation (not attributes).

public class SomeClass : IValidatableObject
{
    public int Id { get; set; }
    public int LowNumber { get; set; }
    public int HighNumber { get; set; }

    public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
    {
        if (LowNumber > HighNumber)
        {
            yield return new ValidationResult("LowNumber should not be higher than HighNumber.");
        }
    }
}

Now to the question. Is server side validation applied automagically, and how? How do I disable this? I want to control this myself – saying something like this in my post action:

[HttpPost]
public string SomeAction(SomeClass model)
{
    if (TryValidateModel(model))
        return "All good";
    else
        return "No good"; 
}

Doing this makes the validation being called – and displayed – twice. Once for this call, and once from someone else. Who?

  • 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-25T09:44:39+00:00Added an answer on May 25, 2026 at 9:44 am

    If you use validation attributes (or the IValidatableObject interface) then the server side validation will always be done when the model is bound using the model binder. If you wanted to override the server side validation I believe you would need to create your own model binder.

    Some good information on the topic here and a great article on the binder and the validation pipeline here.

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

Sidebar

Related Questions

I'm trying to add unit testing to an ASP.NET MVC application I have built.
I have this ASP.NET MVC application that I now want to separate out the
I was trying to download some ASP.NET MVC Sample application to learn MVC. I
I have a forum like web application written in Asp.net MVC. I'm trying to
I'm trying to add simple Authentication and Authorization to an ASP.NET MVC application. I'm
I have an ASP.NET MVC application. I have the routingUrl as http://myapp/Home/Products/Productname/DocTypename/CountryName Now i
I have asp.net mvc 2 application. since couple of days I was trying to
I’ve created an ASP.NET MVC 4.0 application. Now I’m trying to find a 3rd
I have an asp.net mvc application and i am trying to assign value to
I have an ASP.NET MVC application. I am having multiple drop-down list in my

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.