Link to home
Start Free TrialLog in
Avatar of Member_2_1242703
Member_2_1242703

asked on

Making a selection from an AJAX dropdown extender appear in a textbox inside a repeater in ASP.NET / Javascript

I'm trying to make an AJAX dropdownextender selection (from a list box) that is inside a repeater control, populate the relative text box when a selection is made.

<asp:TextBox ID="tbSeparator" Text=<%#Eval("Separator")%> runat="server" Wrap="False" Width="176" Font-Names="Verdana" ForeColor="#666666"></asp:TextBox>
   <cc1:DropDownExtender ID="ddeSeparator" DropDownControlID="lbSeparator"
        runat="server" DynamicServicePath="" Enabled="True" TargetControlID="tbSeparator"
        HighlightBackColor="WhiteSmoke">
    </cc1:DropDownExtender>
        <asp:ListBox ID="lbSeparator" runat="server"
        CssClass="alwaysontop" OnTextChanged="UpdateSeparator" Height="85px">
</asp:ListBox>

Open in new window


How do I do this?
TIA
Avatar of jitendra patil
jitendra patil
Flag of India image

try the below link code it displays the correct usage of dropdown extender
AJAX Control Toolkit Dropdown Extender Tutorial ASP.NET C#

here's another one
How to use DropDownExtender in asp.net ajax


hope this helps.
Avatar of Member_2_1242703
Member_2_1242703

ASKER

Thanks. I'm able to utilize the dropdown extender, no problem. It's when it's inside a repeater is when I'm running into problems. Also, your links show how to make this happen in the code behind. Per my title, I'm trying to do this on the client side. Thanks again.
can you share your javascript code here?
<script type="text/javascript">
    function closest(ele, className) {
        do {
            ele = ele.parentNode;
            if (ele.className !== undefined && ele.className.indexOf(className) > -1) {
                return ele;
            }
        } while (ele.className !== undefined);
        return null;
    }
    	window.popit = function popit(ele) {
        var de = closest(ele.parentElement, 'entrye');
	de.getElementById("tbSeparator").innerHTML = this.options[this.selectedIndex].text;
    }
</script>

Open in new window


This is one of may variations I've been trying
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1242703
Member_2_1242703

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
glad to know you got the solution,
sorry for the delay,  couldn't get back to you.
Figured it out