当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP.NET > ASP.NET - TextBox(文本框)控件
The TextBox control is used to create a text box where the user can input text.
文本框控件可用来创建用户输入文字用的文本框。
The TextBox control's attributes and properties are listed in our web controls reference page.
在我们的WEB控件参考页中罗列了文本框控件的所有属性。
The example below demonstrates some of the attributes you may use with the TextBox control:
下面所要演示的是你在使用文本框控件时可能会用到的一些属性:
<html> |
The contents and settings of a TextBox control may be changed by server scripts when a form is submitted. A form can be submitted by clicking on a button or when a user changes the value in the TextBox control.
当表单被提交时可通过服务来调整文本框的内容和设定。一张表单可通过点击按钮或是当用户改变文本框的内容时进行提交。
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. The submit subroutine writes a text to the Label control:
在下面的举例中我们在一个.aspx文件中声明了一个文本框控件,含有一个按钮控件,一个标签控件。当触发了提交按钮,提交的子程序给予执行。提交的子程序会在标签控件里写上一些文字:
<script runat="server"> <html> <form runat="server"> </body> |
In the following example we declare one TextBox control and one Label control in an .aspx file. When you change the value in the TextBox and either click outside the TextBox or press the Tab key, the change subroutine is executed. The submit change subroutine writes a text to the Label control:
在下面的举例中我们将在一个.aspx文件中声明一个文本框控件以及一个标签控件。当你改变了文本框的内容并将焦点移离文本框(鼠标点文本框的外面或是按了Tab键),change 子程序将给予执行。change子程序会在标签控件上写上一些文字:
<script runat="server"> <html> <form runat="server"> </body> |