Ajax controltoolkit Learning Log-dropdownexw.control (9)

Source: Internet
Author: User
This control can be added to most ASP. NET Server controls to provide them with a drop-down menu. This drop-down menu is another control.

Here is an example:

1) Create an ASP. NET Ajax-enabled web project in Vs and name it dropdownextender1.

2) drag and drop a label control on the default. aspx page and change its text attribute to select your choice. At the same time, drag and drop a panel on the page, and drag and drop three linkbuttons in it. The view is as follows:

ItsCodeAs follows: 1 < ASP: Label ID = "Label1" Runat = "Server" Text = "Select you choice" Width = "166px" > </ ASP: Label > < BR />
2 < ASP: Panel ID = "Panel1" Runat = "Server" Height = "92px" Width = "163px" Style = "Display: hidden" >
3 < ASP: linkbutton ID = "Linkbutton1" Runat = "Server" Onclick = "Linkbutton_click" > Red </ ASP: linkbutton >
4 < BR />
5 < ASP: linkbutton ID = "Linkbutton3" Runat = "Server" Onclick = "Linkbutton_click" > Green </ ASP: linkbutton > < BR />
6 < ASP: linkbutton ID = "Linkbutton2" Runat = "Server" Onclick = "Linkbutton_click" > Blue </ ASP: linkbutton >
7 </ ASP: Panel >

3) after completing the preceding steps, drag and drop a dragdownextender on the page to set some of its attributes. The view is as follows:

the code is as follows: : dropdownextoff id =" dropdownextender1 " targetcontrolid =" label1 " dropdowncontrolid =" Panel1 " runat =" server " > MAID: dropdownextoff >

Attribute description:
Targetcontrolid: the control that needs to be bound to the dropdownextid. It has a drop-down menu.
Dropdowncontrolid: The following controls are displayed as menus.

4) Finally, drag and drop an updatepanel on the page and put a label in it to select one from the drop-down list and then display its content. The view is as follows:

5) press Ctrl + F5 to view the effect in the browser.

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.