In ASP.NET TextBox, control is used to create text box to provide a text area to the user. Generally, in forms one can find a lot of textboxes. Where, end user provides the text input.
Conceptual
figure
Basic structure of TextBox is as shown below.
[html]<asp:TextBox ID="sptxtBox" runat="server"></asp:TextBox>[/html]
For the 'Name' textbox the interaction diagram is stated below.
Attributes
TextBox has lot of attributes in it. TextMode, rows, columns are the attributes, one use mainly.
TextMode="multiline" - One can use this for any address or description type input, where user has to provide the inputs in multiple lines.
[html]
<asp:TextBox id="spTextBox" TextMode="multiline" runat="server" />
[/html]
TextMode="password" - One can use this where the input type is password.
[html]
<asp:TextBox id="spTextBox" TextMode="password" runat="server" />
[/html]
Example
Below is the example of a textbox, followed by the interaction diagram.
Conceptual
figure
In this form for entering 'Name','Address' and 'Password'. One have been provided with textboxes like.
For 'Name' TextMode is 'SingleLine'.
For 'Address' TextMode is 'MultiLine'.
For 'Password' TextMode is 'Password'.
The difference is clear among all these textboxes.
By default the TextMode of any TextBox is 'SingleLine'.