Monday, March 25, 2013

ASP.NET 4.5 TextBox TextMode Property

Right now everybody is talking about HTML5 and its contains lots of new features like web sockets, canvas, new intput types with validation etc.

ASP.NET 4.5 text mode property enhancement:

With HTML5 new input types is going to be one of coolest feature and in future more and more people are going to use that feature. So in 4.5 development team given a support via TextMode property enhancements.

In earlier versions of ASP.NET we used have only three properties for TextMode property of textbox control.
  1. MultiLine- for multiline textbox.
  2. Password- for password textbox
  3. SignleLine –for single line textbox
With ASP.NET 4.5 you are going to have tons of options with TextMode property.
  1. Color- for Color entries
  2. Date-  for date entries. You can enter dates only
  3. DateTime – for datetime entries with respect to local time zone.
  4. DateTimeLocal- for datetime entries with respect to local time zone.
  5. Email- for email address
  6. Month- for month and year entry.
  7. Number- for  entering numeric values.
  8. Range- for containing range between two numbers.
  9. Search- for search field. A search field is like regular text fields
  10. Tel- for telephone number.
  11. Url- for website url entries. It will only contain urls.
  12. Week- for entering weeks and year.


Let’s try some examples for new 4.5 textbox HTML5 features.


Here how its look when we set TextMode property as date.

Text mode property as date in 4.5


Here is the how it looks when we set TextMode property as color.

Color as textmode property in 4.5 textbox


Here’s it looks when we set TextMode property as month.


That’s it hope you like it. Stay tuned for more..


  1. hi, i'm just new HTML5 and for me everything fine Chrome Browser but its not working Internet Explorer (IE)

  2. It will only work on Ie9 and higher browser versions

    1. How to select multiple colors via single textbox textmode=color

    2. It's a simple textbox. So In textbox you can not expect more then one value.

  3. Thanks for posting the new things...

  4. It look great but how do you display the date say if it was stored in a database, displaying the time in the text mode time works fine but i cant get the date to display.

  5. any body knows about the textmode="date" property in Textbox control which is not showing the calender in Firefox..

    1. Which version of firefox you are using for it as it is a HTML5 features.You need to have HTML5 compliance browser.

    2. Experiencing same problem here. The textbox which has has a date property cannot be viewed in Firefox.

    3. Which version of firefox you are using? The first and formost thing about this to work is your firefox should be capable of HTML5 features.

  6. hi there, i have tried firefox (26), IE 11 and wont work.. Any suggestion?

  7. check your browser is html5 compatible or not.

  8. Same problem here. Using VS2013 on Windows7 64; TextMode works on Chrome, but NOT on IE11. Any suggestion please.

  9. Date textmode is not showing... Is there any thing i can do with it to display the date. ?


Your feedback is very important to me. Please provide your feedback via putting comments.

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog


My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews