A TextBox with height:
<asp:TextBox id="tb6" rows="5" TextMode="multiline"
runat="server" />
<br /><br />
A TextBox with width:
<asp:TextBox id="tb5" columns="30" runat="server" />
</form>
</body>
</html>
Add a Script
The settings and contents of a TextBox control may be changed by server scripts when a form is submitted. A form can be submitted when a user changes the value in the TextBox control or by clicking on a button.
In the following example we declare one TextBox control, one Button control, and one Label control in an .aspx file. When the submit button is triggered, the submit subroutine is executed and the submit subroutine writes a text to the Label control:
<script runat="server">
Sub submit(sender As Object, e As EventArgs)
lbl1.Text="Your name is " & txt1.Text
End Sub
</script>
<html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>
The example given below declare one TextBox control and one Label control in an .aspx file.
When you change the value in the TextBox and either click press the Tab key or outside the TextBox,
the change subroutine is executed.To the Label control,the submit subroutine writes a text:
<script runat="server">
Sub change(sender As Object, e As EventArgs)
lbl1.Text="You changed text to " & txt1.Text
End Sub
</script>
<html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server"
text="Hello World!"
ontextchanged="change" autopostback="true"/>
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
ASP .NET using The TextBox Control,
visual basic textbox,
asp visual basic,
visual basic using,
visual basic control,
asp datagrid,
c# using,
datagrid textbox,
textbox code,
javascript textbox,
html textbox,
asp array,
datagrid control,
textbox postback,
c# textbox,
dataset textbox,
textbox validation,
asp javascript,
asp database,
asp function,
datalist control,
asp xml,
control data,
xml textbox,
asp c#,
repeater control,
asp form,
dropdownlist control,
textbox properties,
vb textbox,
repeater textbox,
asp string,
textbox array,
form textbox,
c# control,
asp code