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 asp.net 4.5 asp.net 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 asp.net 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.

Examples:


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

Date:

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

Text mode property as date in asp.net 4.5

Color:

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

Color as textmode property in asp.net 4.5 textbox

Month:

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

image

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

19 comments:

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

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

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

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

      Delete
  3. Thanks for posting the new things...

    ReplyDelete
  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.

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

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

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

      Delete
    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.

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

    ReplyDelete
  7. check your browser is html5 compatible or not.

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

    ReplyDelete

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