Ajax controltoolkit Learning Log-popupcontrolextender (21)

Source: Internet
Author: User
The popupcontrolextender control can be combined with any Asp.net Server Control to bring up a panel and select it.

The following is an example:

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

2) In default. on the ASPX page, drag and drop a Textbox Control named textbox1. Then, drag and drop a panel under the control named Panel1. Drag and Drop An updatepanel in Panel1 and name it updatepanel1; drag and Drop a radiobuttonlist control in updatepanel1 to display options.

CodeAs follows:

1 < ASP: textbox ID = "Textbox1" Runat = "Server" > </ ASP: textbox > < BR />
2 & Nbsp;
3 < ASP: Panel ID = "Panel1" Runat = "Server" Height = "114px" Cssclass = "Popupclass" Width = "125px" >
4 & Nbsp; < ASP: updatepanel ID = "Updatepanel1" Runat = "Server" >
5 < Contenttemplate >
6 & Nbsp; < ASP: radiobuttonlist ID = "Radiobuttonlist1" Runat = "Server" Height = "96px" Width = "80px" Onselectedindexchanged = "Radiobuttonlistpolicselectedindexchanged" Autopostback = "True" >
7 < ASP: listitem > Eat </ ASP: listitem >
8 < ASP: listitem > Sleep </ ASP: listitem >
9 < ASP: listitem > Walk </ ASP: listitem >
10 < ASP: listitem > Speak </ ASP: listitem >
11 </ ASP: radiobuttonlist >
12 </ Contenttemplate >
13 </ ASP: updatepanel >
14 </ ASP: Panel >


3) after completing the preceding steps, drag and drop a popupcontrolextender on the page, name it popupcontrolextender1, and set its attributes.

The Code is as follows: 1 < C0: popupcontrolextender ID = "Popupcontrolextender1" Runat = "Server" Popupcontrolid = "Panel1"
2 Position = "Bottom" Commitproperty = "Value" Targetcontrolid = "Textbox1" > </ C0: popupcontrolextender >
3


Attribute description:
Targetcontrolid: The target control associated with the control.
Popupcontrolid: When the target control obtains the focus, the displayed control is displayed.
Position: Position of the displayed control relative to the target control.
Commitproperty: Select a value in the pop-up panel to set the properties of the target control.

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

As follows:

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.