Learn the WebForms technology of. NET through cases (i)
/*
Tofu production, are fine
Http://www.asp888.net Tofu Technology Station
If reproduced please retain the full copyright information
*/
Textbox:
The TextBox is the input control in the ASP.net, he has three forms, respectively corresponds <input type=text>,<input type=password> and the <TextArea>
These three HTML tags, in asp.net, the textbox is defined in a format that is
<asp:textbox runat=server id= "Text1" text= "Tofu technology station" .../>
How code is defined
<script language= "C #" runat=server>
void AddText () {
TextBox text1=new textbox ();
Text1. text= "Tofu Technology Station";
。。。。。。
}
</script>
The above is a brief introduction to the TextBox, and here is a detailed look at some of the main properties of the TextBox and how they are used
AccessKey, which enables the textbox to be focused on the page by alt+[the specified key]: for example:
<asp:textbox id= "TextBox1" text= "Tofu production http://www.asp888.net" runat= "Server"/>
Or:
Textbox1.accesskey= "Y";
Attributes, assign values to the properties of a TextBox control, such as:
textbox1.attributes["MaxLength"]= "20"; The attributes makes it easy to identify some of the HTML
Very convenient assignment in the
TextMode is a very, very important attribute in the textbox, and we need to use him to determine the type of our current input.
Three of his assigned values
Textbox1.textmode=textboxmode.singleline; Single Line Input box
Textbox1.textmode=textboxmode.multiline; Multi-line Input box
Textbox1.textmode=textboxmode.password; Password input Box
Text is the property of the data in the input box where we access the textbox, and he is readable and writable.
In addition, there are some control properties for the appearance properties of the textbox, such as Font,tooltip, and so on, because there is basically no need to programmatically
So there's no detailed explanation here.
Label is the control that we use to display output in asp.net, and we still have two ways of defining this space.
<asp:label runat=server id= "Label" text= "Tofu technology station" .../>
How code is defined
<script language= "C #" runat=server>
void AddText () {
Label Label1=new label ();
Label. text= "Tofu Technology Station";
。。。。。。
}
</script>
One of our most common uses is the property of text
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.