Populate drop down as per the code written in text box
I have just used this method in one of my .net project. u just add this method in ur .js file and call this from ur aspx page.
function SearchItem(textbox, dropdown, chk)
{
if(chk)
{
for(var i=0; i<=dropdown.length; i++)
{
if(textbox.value == dropdown
.value)
{
dropdown.selected = true;
break;
}
}
}
else
textbox.value = dropdown.value;
}
in controls page add this property in ur aspx page:
<asp:TextBox ID="txt" runat="server" MaxLength="20" OnBlur="javascript:SearchItem(<%=txt.ClientID %>,<%=ddl.ClientID %>,true);"></asp:TextBox>
<aspropDownList ID="ddl" runat="server" onchange="javascript:SearchItem(<%=txt.ClientID %>,<%=ddl.ClientID %>);" />
:flute: