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.
- MultiLine- for multiline textbox.
- Password- for password textbox
- SignleLine –for single line textbox
With ASP.NET 4.5 there are
number of options with Textmode property,which are as follows:
- Color- This can be use for Color
entries
- Date- It is use for date
entries. You can enter dates only
- DateTime – It is use for datetime
entries with respect to local time zone.
- DateTimeLocal- It is use for datetime
entries with respect to local time zone.
- Email- It is use for email address
- Month- This can be use for month
and year entry.
- Number- It is use for
entering numeric values.
- Range- This can be use for
containing range between two numbers.
- Search- This can be use for search
field. A search field is like regular text fields
- Tel- It is use for telephone
number.
- Url- Used for entering website
url e. It will only contain urls.
- 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.