ASP.NET Mobile TextBox Control[转]
Definition and Usage
定义和用法
The TextBox control is used to create a single-line input box on a mobile device.
TextBox[文本框] 控件的作用是:在一个移动设备上创建一个单行的文本输入框。
The text can be specified by the text attribute or as the content of the TextBox element. If the text is specified in both ways, the inner text takes precedence. However, if the text is programmatically set, the inner text is replaced with this text.
该文本可以通过文本属性指定,或者作为TextBox元素的内容来指定。如果同使用上述两种方法来指定,那么将优先处理内置文本。然而,如果文本使用程序自动设置的,那么内置文本将被该输入文本所取代。
Properties
属性
| Property 属性 |
Value 值 |
Description 描述 |
|---|---|---|
| Alignment | left center right |
Optional. How to align the textbox 可选参数。指定文本框的对齐方式 |
| BackColor | rgb(x,x,x) #xxxxxx colorname |
Optional. A background color for the textbox 可选参数。指定文本框的背景颜色 |
| ForeColor | rgb(x,x,x) #xxxxxx colorname |
Optional. A foreground color for the textbox 可选参数。指定文本框的前景颜色 |
| Font-Bold | false true |
Optional. Specifies whether or not the text in the textbox should be bold 可选参数。指定文本框中的文本字体是否以粗体显示 |
| Font-Italic | false true |
Optional. Specifies whether or not the text in the textbox should be italic 可选参数。指定文本框中的文本字体是否以斜体显示 |
| Font-Name | fontname | Optional. Specifies the font name of the text in the textbox 可选参数。指定文本框中文本的字体名称 |
| Font-Size | normal small large |
Optional. Specifies the font size of the text in the textbox 可选参数。指定文本框中的字体尺寸大小 |
| id | unique_name | Optional. A unique id for the control 可选参数。为控件指定一个独立的id |
| MaxLength | number_of_char | Optional. The maximum number of characters allowed in the textbox 可选参数。指定文本框中允许输入的最大字符位数 |
| Numeric | true false |
Optional. Specifies whether or not the value of the textbox should be numeric 可选参数。指定是否允许在文本框中输入数字 |
| OnTextChanged | function_name | Optional. The name of the function to be executed when the text is changed 可选参数。当文本被改变时,制定执行的函数名称 |
| Password | true false |
Optional. Specifies whether or not the textbox should be treated as a password field 可选参数。指定文本框是否作为密码输入区 |
| runat | "server" | Required. Specifies that the control is a server control 必要参数。指定该控件是否为服务器控件 |
| Size | size_of_textbox | Optional. The size of the textbox (in characters) 可选参数。指定文本框的尺寸大小(单位:字符数) |
| StyleReference | name_of_style_element | Optional. Specifies a reference to a style to be applied to the control 可选参数。指定一个应用于控件的样式参数 |
| Text | text | Optional. The text to display in the textbox 可选参数。指定在文本框中显示的文本 |
| Wrapping | wrap nowrap |
Optional. Specifies whether or not the text in the textbox should wrap 可选参数。指定文本框中的文本是否允许被嵌套 |
Example 1
案例1
The following example will declare two forms in an .aspx file. The first form has a label with the text "Age?", a textbox to input the age, and a submit button. The second form is activated by the submit button on the first form, and displays a response:
下面的案例将在 .aspx 文件中声明两张表单。第一张表单的标签文本是“Age”,并包含“Age” 标签所对应的文本框以及一个提交按钮。第二张表单将通过第一张表单的提交按钮激活,并显示对应的回应信息:
<%@ Page <script runat="server"> <Mobile:Form id="form1" runat="server"> <Mobile:Form id="form2" runat="server" |
浙公网安备 33010602011771号