Learn the WebForms technology of. NET through cases (III.)

Source: Internet
Author: User
Learn the WebForms technology of. NET through cases (III.)
/*
Tofu production is a boutique
Http://www.asp888.net Tofu Technology Station
If reproduced please retain the full copyright information
*/
DropDownList:
DropDownList the <select in the corresponding form element. > We also have two ways of defining his definition.
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
<asp:listitem>item 1</asp:listitem>
<asp:listitem>item 2</asp:listitem>
<asp:listitem>item 3</asp:listitem>
<asp:listitem>item 4</asp:listitem>
</asp:DropDownList>
How code is defined:
DropDownList dropdownlist1=new DropDownList ();

The key to the use of the attributes are mainly:
SelectedItem This property is a ListItem Class and we're going to explain the ListItem attribute.

ListItem Property,

Because what we are most concerned about DropDownList is the results we get when we choose to DropDownList.
So, the nature of our most concern for ListItem is the text and Value properties
Text is the result of ListItem in appearance
Value is the real value of the Item we selected

In conclusion, we summarize the usage of the SelectedItem attribute of DropDownList
DropDownList1. Selecteditem.text and DropDownList1. Selecteditem.value


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.