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

The Archive Base Latest Questions

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

Is there a way using MVC data validation attributes to validate client side if

  • 0

Is there a way using MVC data validation attributes to validate client side if two fields on my model are equal.

I have two fields:

    [Required(ErrorMessage = "*")]
    [Email(ErrorMessage = "*")]
    public string Email { get; set; }

    [Required(ErrorMessage = "*")]
    [Email(ErrorMessage = "*")]
    public string ConfirmEmail { get; set; }

I want to be able to add an attribute that those two fields should be equel and if not an validatio error will appear. Is there a way to do so?

Thank you.

  • 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-25T02:44:46+00:00Added an answer on May 25, 2026 at 2:44 am

    Yep – for example:

    [Compare("Email", ErrorMessage = "The email and confirmation do not match.")]
    

    Hope that helps.

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

Sidebar

Related Questions

I am using Data Annotations to validate my Model in ASP.NET MVC. This works
I'm using ASP.NET MVC 3 code-first and I have added validation data annotations to
Is there a way to use simple sql queries on ASP MVC without using
Using ASP.Net MVC 2, is there any way to use the RedirectToAction() method of
I have an ASP.NET MVC 2 form that is working perfectly, doing client side
I'm using the Data Annotation validation extensively in ASP.NET MVC 2. This new feature
When I started using xVal for client-side validation, I was only implementing action methods
I am using MVC. I have a view model which contains a Business object.
In MVC, is there a way to fire an onBeforeSubmit event when using Ajax.BeginForm?
Is there a way using the iPhone SDK to get WiFi information? Things like

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.