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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:25:50+00:00 2026-05-31T19:25:50+00:00

I can do this easily using a TextBoxFor but how do I do it

  • 0

I can do this easily using a TextBoxFor but how do I do it with an EditorFor?

I figured using the DataAnnotation [DataType(DataType.EmailAddress)] but that doesn’t do it.

I don’t quite understand what the DataType annotation actually does because it doesn’t seem to do anything at all at first glance.

  • 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-31T19:25:51+00:00Added an answer on May 31, 2026 at 7:25 pm

    The EditorFor helper method is somewhat limited out of the box and doesn’t yet appear to support the HTML5 type="email" attribute.

    Your options right now seem to be either using TextBoxFor or creating a custom template that will allow you to set the input’s type attribute. Here’s another thread that reviews some of the options for creating your own templates.

    The DataAnnotation [DataType(DataType.EmailAddress)] is actually quite useful. It sets the id and name of your form field to email, which you can use with jQuery validation to show the user client-side validation messages. Applying the DataAnnotation to your model class also means that the email property on your model will be automatically validated on the server side. If you enable unobtrusive validation in your app, you get client- and servers-side validation almost for free.

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

Sidebar

Related Questions

I know that this can be easily done by using if(i%5 == 0 OR
I know something like this can be accomplished easily using PHP or Perl, but
I know that you can do this easily with HQL using the following syntax:
I know this can be done easily using jQuery but haven't been able to
Using scons I can easily set my include paths: env.Append( CPPPATH=['foo'] ) This passes
This maybe a stupid question, but as I can not easily undo my change
Humm... I can do this easily in Java (and all other languages) but, it
I wonder if fancy animations such as this can easily be done using JavaScript
I know this can be easily done using PHP's parse_url and parse_str functions: $subject
I know that an incoming sms can be easily intercepted using a broadcast reciever.

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.