TextBox's Textmode property in Asp.net 4.5

Introduction

Here I am going to discuss about TextBox's Textmode property enhancement. Text Box control's Textmode property support

 HTML5 types . In ASP.NET 4.5  there are  number of options with Textmode property,which are supported by different browers

Description

In previous versions of ASP.NET there were 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  there are  number of options with Textmode property,which are as follows:

  1. Color- This can be use for Color entries
  2. Date-  It is use for date entries. You can enter dates only
  3. DateTime – It is use for datetime entries with respect to local time zone.
  4. DateTimeLocal- It is use for datetime entries with respect to local time zone.
  5. Email- It is use for email address
  6. Month- This can be use for month and year entry.
  7. Number- It is use for  entering numeric values.
  8. Range- This can be use for containing range between two numbers.
  9. Search- This can be use for search field. A search field is like regular text fields
  10. Tel- It is use for telephone number.
  11. Url- Used for entering website url e. It will only contain urls.
  12. Week- for entering weeks and year.

Example

Select File > New Project and in the New Project dialog select “ASP.NET Web Forms Application” template


You can choose a TextBox from the tool box and set the Textmode property as follows:

 <asp:TextBox ID="phone" runat="server" Textmode="Date"></asp:TextBox
<
asp:TextBox ID="phone" runat="server" Textmode="Color"></asp:TextBox>

Same like this you can select any Textmode property as desired as use it for different purpose.

Ebook Download
View all
Learn
View all