Insisting on learning asp.net--(III.)

Source: Internet
Author: User
Tags html form html tags valid
Several asp.net forms are:



ASP.net's response:



How the form works in asp.net:

The server control is actually generated dynamically on the server and then sent out.

Tags are: <form runat= "Server" >

All asp.net forms are delivered using post.

The ASP.net form is stateful, if it has a form, and if you have entered the content, its contents are retained, and the HTML form is stateless and cannot be done. (In practice, HTML forms can have this function in a short time, but the password file is clear.) )

asp.net server control:

Asp:label Control:

To put it bluntly, this dummy control is designed to completely separate the code from the HTML code, and its role is to precompile and generate text that is displayed in some specific position related to the character. He acts like a span or div in HTML, and look at its properties below.

First of all should be runat, obviously it belongs to the ASP.net control, naturally can only be runat= "server".

The remaining attributes have the following:

BackColor, ForeColor, Height, ID, Text, Visible, Width, are very well understood, needless to say.

Asp:dropdownlist Control

First look at the normal use of it.

<form runat= "Server" >
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
<asp:listitem value= "123" > Project 1</asp:listitem>
<asp:listitem value= "23234" > Project 2</asp:listitem>
<asp:listitem value= "453" > Project 3</asp:listitem>
</asp:DropDownList>
</form>

We know that it is the same as the select-option tag in HTML, but it runs on the server side and generates HTML tags after compiling.

Asp:listbox Control

Normal use:

<form runat= "Server" >
<asp:listbox id= "ListBox1" runat= "Server" selectionmode= "multiple" >
<asp:listitem value= "4324" > Project 1</asp:listitem>
<asp:listitem value= "23432" > Project 3</asp:listitem>
<asp:listitem value= "565" > Project 4</asp:listitem>
<asp:listitem value= "467567" > Project 2</asp:listitem>
</asp:ListBox>
</form>

where selectionmode= "multiple" indicates whether it allows multiple selections. It's almost the same function as ASP:DROPDOWNLISTJ, but the difference is that it can't pull down.

Asp:textbox Control:

Normal use:

<asp:textbox id= "TextBox1" text= "123" rows= "3" columns= "2" tooltip= "maxlength=" "textmode=" MultiLine "runat=" Server "/>

TextMode property: One row, no value, multiple lines, multiline, or password if the password is entered.

Rows Property: Specifies the number of lines of text. This is only valid if the TextMode property is set to Multiline.

Columns Property: Specifies the number of columns for the text.

Asp:radiobutton & Asp:radiobuttonlist Controls:

Use:

<asp:radiobutton id= "RadioButton1" text= "" textalign= "left" runat= "Server"/>

<asp:radiobuttonlist id= "RadioButtonList1" runat= "Server" >
<asp:listitem value= "122" > Project 1</asp:listitem>
<asp:listitem value= "222" > Project 2</asp:listitem>
<asp:listitem value= "333" > Project 3</asp:listitem>
</asp:RadioButtonList>

Asp:radiobutton has a groupname attribute, which translates to HTML as its Name property.

Asp:checkbox & Asp:checkboxlist

<asp:checkbox id= "CheckBox1" text= "MMBVN" runat= "Server"/>

<asp:checkboxlist id= "CheckBoxList1" runat= "Server" >
<asp:listitem value= "bn" > Project 1</asp:listitem>
<asp:listitem value= "NB" > Project 2</asp:listitem>
</asp:CheckBoxList>

Attributes are similar to the previous.

Types of forms:



ASP.net's response:



How the form works in asp.net:

The server control is actually generated dynamically on the server and then sent out.

Tags are: <form runat= "Server" >

All asp.net forms are delivered using post.

The ASP.net form is stateful, if it has a form, and if you have entered the content, its contents are retained, and the HTML form is stateless and cannot be done. (In practice, HTML forms can have this function in a short time, but the password file is clear.) )

asp.net server control:

Asp:label Control:

To put it bluntly, this dummy control is designed to completely separate the code from the HTML code, and its role is to precompile and generate text that is displayed in some specific position related to the character. He acts like a span or div in HTML, and look at its properties below.

First of all should be runat, obviously it belongs to the ASP.net control, naturally can only be runat= "server".

The remaining attributes have the following:

BackColor, ForeColor, Height, ID, Text, Visible, Width, are very well understood, needless to say.

Asp:dropdownlist Control

First look at the normal use of it.

<form runat= "Server" >
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
<asp:listitem value= "123" > Project 1</asp:listitem>
<asp:listitem value= "23234" > Project 2</asp:listitem>
<asp:listitem value= "453" > Project 3</asp:listitem>
</asp:DropDownList>
</form>

We know that it is the same as the select-option tag in HTML, but it runs on the server side and generates HTML tags after compiling.

Asp:listbox Control

Normal use:

<form runat= "Server" >
<asp:listbox id= "ListBox1" runat= "Server" selectionmode= "multiple" >
<asp:listitem value= "4324" > Project 1</asp:listitem>
<asp:listitem value= "23432" > Project 3</asp:listitem>
<asp:listitem value= "565" > Project 4</asp:listitem>
<asp:listitem value= "467567" > Project 2</asp:listitem>
</asp:ListBox>
</form>

where selectionmode= "multiple" indicates whether it allows multiple selections. It's almost the same function as ASP:DROPDOWNLISTJ, but the difference is that it can't pull down.

Asp:textbox Control:

Normal use:

<asp:textbox id= "TextBox1" text= "123" rows= "3" columns= "2" tooltip= "maxlength=" "textmode=" MultiLine "runat=" Server "/>

TextMode property: One row, no value, multiple lines, multiline, or password if the password is entered.

Rows Property: Specifies the number of lines of text. This is only valid if the TextMode property is set to Multiline.

Columns Property: Specifies the number of columns for the text.

Asp:radiobutton & Asp:radiobuttonlist Controls:

Use:

<asp:radiobutton id= "RadioButton1" text= "" textalign= "left" runat= "Server"/>

<asp:radiobuttonlist id= "RadioButtonList1" runat= "Server" >
<asp:listitem value= "122" > Project 1</asp:listitem>
<asp:listitem value= "222" > Project 2</asp:listitem>
<asp:listitem value= "333" > Project 3</asp:listitem>
</asp:RadioButtonList>

Asp:radiobutton has a groupname attribute, which translates to HTML as its Name property.

Asp:checkbox & Asp:checkboxlist

<asp:checkbox id= "CheckBox1" text= "MMBVN" runat= "Server"/>

<asp:checkboxlist id= "CheckBoxList1" runat= "Server" >
<asp:listitem value= "bn" > Project 1</asp:listitem>
<asp:listitem value= "NB" > Project 2</asp:listitem>
</asp:CheckBoxList>

Attributes are similar to the previous.

Types of forms:



ASP.net's response:



How the form works in asp.net:

The server control is actually generated dynamically on the server and then sent out.

Tags are: <form runat= "Server" >

All asp.net forms are delivered using post.

The ASP.net form is stateful, if it has a form, and if you have entered the content, its contents are retained, and the HTML form is stateless and cannot be done. (In practice, HTML forms can have this function in a short time, but the password file is clear.) )

asp.net server control:

Asp:label Control:

To put it bluntly, this dummy control is designed to completely separate the code from the HTML code, and its role is to precompile and generate text that is displayed in some specific position related to the character. He acts like a span or div in HTML, and look at its properties below.

First of all should be runat, obviously it belongs to the ASP.net control, naturally can only be runat= "server".

The remaining attributes have the following:

BackColor, ForeColor, Height, ID, Text, Visible, Width, are very well understood, needless to say.

Asp:dropdownlist Control

First look at the normal use of it.

<form runat= "Server" >
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
<asp:listitem value= "123" > Project 1</asp:listitem>
<asp:listitem value= "23234" > Project 2</asp:listitem>
<asp:listitem value= "453" > Project 3</asp:listitem>
</asp:DropDownList>
</form>

We know that it is the same as the select-option tag in HTML, but it runs on the server side and generates HTML tags after compiling.

Asp:listbox Control

Normal use:

<form runat= "Server" >
<asp:listbox id= "ListBox1" runat= "Server" selectionmode= "multiple" >
<asp:listitem value= "4324" > Project 1</asp:listitem>
<asp:listitem value= "23432" > Project 3</asp:listitem>
<asp:listitem value= "565" > Project 4</asp:listitem>
<asp:listitem value= "467567" > Project 2</asp:listitem>
</asp:ListBox>
</form>

where selectionmode= "multiple" indicates whether it allows multiple selections. It's almost the same function as ASP:DROPDOWNLISTJ, but the difference is that it can't pull down.

Asp:textbox Control:

Normal use:

<asp:textbox id= "TextBox1" text= "123" rows= "3" columns= "2" tooltip= "maxlength=" "textmode=" MultiLine "runat=" Server "/>

TextMode property: One row, no value, multiple lines, multiline, or password if the password is entered.

Rows Property: Specifies the number of lines of text. This is only valid if the TextMode property is set to Multiline.

Columns Property: Specifies the number of columns for the text.

Asp:radiobutton & Asp:radiobuttonlist Controls:

Use:

<asp:radiobutton id= "RadioButton1" text= "" textalign= "left" runat= "Server"/>

<asp:radiobuttonlist id= "RadioButtonList1" runat= "Server" >
<asp:listitem value= "122" > Project 1</asp:listitem>
<asp:listitem value= "222" > Project 2</asp:listitem>
<asp:listitem value= "333" > Project 3</asp:listitem>
</asp:RadioButtonList>

Asp:radiobutton has a groupname attribute, which translates to HTML as its Name property.

Asp:checkbox & Asp:checkboxlist

<asp:checkbox id= "CheckBox1" text= "MMBVN" runat= "Server"/>

<asp:checkboxlist id= "CheckBoxList1" runat= "Server" >
<asp:listitem value= "bn" > Project 1</asp:listitem>
<asp:listitem value= "NB" > Project 2</asp:listitem>
</asp:CheckBoxList>

Attributes are similar to the previous.

Types of forms:



ASP.net's response:



How the form works in asp.net:

The server control is actually generated dynamically on the server and then sent out.

Tags are: <form runat= "Server" >

All asp.net forms are delivered using post.

The ASP.net form is stateful, if it has a form, and if you have entered the content, its contents are retained, and the HTML form is stateless and cannot be done. (In practice, HTML forms can have this function in a short time, but the password file is clear.) )

asp.net server control:

Asp:label Control:

To put it bluntly, this dummy control is designed to completely separate the code from the HTML code, and its role is to precompile and generate text that is displayed in some specific position related to the character. He acts like a span or div in HTML, and look at its properties below.

First of all should be runat, obviously it belongs to the ASP.net control, naturally can only be runat= "server".

The remaining attributes have the following:

BackColor, ForeColor, Height, ID, Text, Visible, Width, are very well understood, needless to say.

Asp:dropdownlist Control

First look at the normal use of it.

<form runat= "Server" >
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
<asp:listitem value= "123" > Project 1</asp:listitem>
<asp:listitem value= "23234" > Project 2</asp:listitem>
<asp:listitem value= "453" > Project 3</asp:listitem>
</asp:DropDownList>
</form>

We know that it is the same as the select-option tag in HTML, but it runs on the server side and generates HTML tags after compiling.

Asp:listbox Control

Normal use:

<form runat= "Server" >
<asp:listbox id= "ListBox1" runat= "Server" selectionmode= "multiple" >
<asp:listitem value= "4324" > Project 1</asp:listitem>
<asp:listitem value= "23432" > Project 3</asp:listitem>
<asp:listitem value= "565" > Project 4</asp:listitem>
<asp:listitem value= "467567" > Project 2</asp:listitem>
</asp:ListBox>
</form>

where selectionmode= "multiple" indicates whether it allows multiple selections. It's almost the same function as ASP:DROPDOWNLISTJ, but the difference is that it can't pull down.

Asp:textbox Control:

Normal use:

<asp:textbox id= "TextBox1" text= "123" rows= "3" columns= "2" tooltip= "maxlength=" "textmode=" MultiLine "runat=" Server "/>

TextMode property: One row, no value, multiple lines, multiline, or password if the password is entered.

Rows Property: Specifies the number of lines of text. This is only valid if the TextMode property is set to Multiline.

Columns Property: Specifies the number of columns for the text.

Asp:radiobutton & Asp:radiobuttonlist Controls:

Use:

<asp:radiobutton id= "RadioButton1" text= "" textalign= "left" runat= "Server"/>

<asp:radiobuttonlist id= "RadioButtonList1" runat= "Server" >
<asp:listitem value= "122" > Project 1</asp:listitem>
<asp:listitem value= "222" > Project 2</asp:listitem>
<asp:listitem value= "333" > Project 3</asp:listitem>
</asp:RadioButtonList>

Asp:radiobutton has a groupname attribute, which translates to HTML as its Name property.

Asp:checkbox & Asp:checkboxlist

<asp:checkbox id= "CheckBox1" text= "MMBVN" runat= "Server"/>

<asp:checkboxlist id= "CheckBoxList1" runat= "Server" >
<asp:listitem value= "bn" > Project 1</asp:listitem>
<asp:listitem value= "NB" > Project 2</asp:listitem>
</asp:CheckBoxList>

Attributes are similar to the previous.



Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.