ASP.NET Tutorial – Chapter 2: Using the textbox control


<html>
<body>
<span style="color: #008000;"><form runat="server"></span>

TextBox Example 1:

<span style="color: #008000;"><asp:TextBox id="tb1" runat="server" /></span>
<br /><br />

TextBox Example 2:

<span style="color: #008000;"><asp:TextBox id="tb2" TextMode="password" runat="server" /></span>
<br /><br />

TextBox Example 3:

<span style="color: #008000;"><asp:TextBox id="tb4" Text="Good Morning runat="server" /></span>
<br /><br />

TextBox Example 4:

<span style="color: #008000;"><asp:TextBox id="tb3" TextMode="multiline" runat="server" /></span>
<br /><br />

TextBox Example 5:

<span style="color: #008000;"><asp:TextBox id="tb6" rows="5" TextMode="multiline" runat="server" /></span>
<br /><br />

TextBox Example 6:

<span style="color: #008000;"><asp:TextBox id="tb5" columns="30" runat="server" /></span>
</form>
</body>
</html>


Also you can use a text box to display information in the same ASP.NET
page. The following example shows you how to do this.

<html>
<body>
<span style="color: #008000;"><form runat="server"></span>
WHAT’S YOUR NAME:<span style="color: #008000;">
</span><span style="color: #008000;"><asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p></span><span style="color: #008000;"><asp:Label id="lbl1" runat="server" /></p></span>
<span style="color: #008000;"></form></span>
</body>
</html>

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.