Ajax Drop Down Extender

20 September, 2018

Related Blogs

Drop Down Extender

DropDownExtender is used to make a control DropDown when user click on another control and immediately after user select a option fromit  the control dropeddown will be automatically hidden. Properties Target ControlID: DropDownControlID: Used to specify the ID of the control to dropdown when user click on the target control. Example The following example demonstrates how to use dropdown Extender control. Add apage to the website and then place a Toolkit Script manager on ti and then an Image control & just below the Image control take a panel and within the panel take three linkbuttons with the captions get to Name of an Image available in  your website. Within code of the page create a method with the name linkclicked and with inthat methos write the following code.   protected void LinkClicked(object Sender,EventArgs e) { string path=”~/image/”+((LinkButton) sender).Text+”.jpg”; Image1.ImageUrl=path; } With in the properties of 3 LinkButtons get the click event to name of the methos we created in the code that is ‘LinkClicked’. Set ImageUrl Property for the Image control within the pageload event as follows to display the Image in Image Control Immediately page is loaded. -Page Load – Image1.ImageUrl=”~/Images/Tulips.jpg”; Within HTML source of the page drag and DropDownExtender and set following properties to it. <asp:DropDownExtender ID=”DropDownExtender1” runat=”server” TargetcontrolID=”Image1”DropDownControlID=”Panel1”> </asp:DropDownExtender> At runtime when you click on the image then the panel will dropDownjust below the Image control and clicking on LinkButtion will display corresponding Image with in the ImageControl and the panel will be automatically hidden. * visualstudio-2012.
About Author


Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .