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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:26:26+00:00 2026-05-20T15:26:26+00:00

I have a model [Required(ErrorMessage = Email required)] [DataType(DataType.EmailAddress, ErrorMessage = Please enter valid

  • 0

I have a model

 [Required(ErrorMessage = "Email required")]
[DataType(DataType.EmailAddress, ErrorMessage = "Please enter valid email address")]
public string Email { get; set; }

From that I want the view to return

 <input type="email" value="" name="Email" id="Email" data-val-required="Email required" data-val="true">  

and also option to use jquery.validate.unobtrusive on the email address without including a regx.

But by default the type=”text” and I do not get email validation. I only get required field validation
What is the easiest way to do this?

html5.js
or http://deanhume.com/Home/BlogPost/asp-net-mvc-html5-toolkit/29 (I tried this it make the type=”email” but ignores by data Annotations so I miss out on my client side validation)

or just make a HTML helper

or can I just manually override the type and add data-val-email to my class

  • 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-20T15:26:26+00:00Added an answer on May 20, 2026 at 3:26 pm

    You may take a look at the following blog post.

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

Sidebar

Related Questions

I have following property in my Model Metadata class: [Required(ErrorMessage = Spent On is
I have a model defined as public class Department { [ScaffoldColumn(false)] public object Id
I am using asp.net MVC2. I have a model defined as public class Department
I have a model as follows: namespace MvcApplication1.Models { public enum Sex { Male,
So I have a page to edit employees. Here is my view model: public
I have a model being populated by my data layer and then I have
I have some model objects I'm using in my Java client application. Later these
I have a model, Thing, that has a has_many with ThingPhoto, using Paperclip to
I have a model Question with a field called userid , before one ask
I have a model Foo which have a ForeignKey to the User model. Later,

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.