Search code examples
asp.netasp.net-ajaxajaxcontroltoolkit

Modifying the AJAX Control Toolkit Dropdown extender


I am using the example on the AJAX website for the DropDownExtender. I'm looking to make the target control (the label) have the DropDown image appear always, instead of just when I hover over it.

Is there any way to do this?


Solution

  • This can be done using the following script tag:

    
    <script>
        function pageLoad()
        {
            $find('TextBox1_DropDownExtender')._dropWrapperHoverBehavior_onhover();
            $find('TextBox1_DropDownExtender').unhover = VisibleMe;
        }  
    
        function VisibleMe()
        {
            $find('TextBox1_DropDownExtender')._dropWrapperHoverBehavior_onhover();
        }
    </script>
    

    I found this and some other tips at this dot net curry example.

    It works but I'd also consider writing a new control based on the drop down extender exposing a property to set the behaviour you want on or off.

    Writing a new AJAX control isn't too hard, more fiddly than anything.