I have currently added the selected jquery plugin to my asp project via nuget.
Install-Package DropDownListChosen
then on one of the aspx pages I used a dropdown like
// asp conent page <asp:DropDownListChosen ID="listBoxAddress" runat="server" NoResultsText="No results match." Width="350px" DataPlaceHolder="Type Here..." AllowSingleDeselect="true"> </asp:DropDownListChosen> // code behind public void GetAddress() { try { DataTable dt = new DataTable(); listBoxAddress.ClearSelection(); listBoxAddress.Items.Clear(); DAL_Customer_Registration objDAL = new DAL_Customer_Registration(); dt = objDAL.Get_Address(); foreach (DataRow row in dt.Rows) { listBoxAddress.Items.Add(new ListItem(row["ADDRESS"].ToString(), row["ID"].ToString())); } } catch (Exception) { } }
On my main page I added .css of the selected plugin
<link rel="stylesheet" media="screen,projection" type="text/css" href="~/chosen.css" />
But still the items in the drop-down list are not displayed. Why is this so? What is wrong with my process? What other links should be added to the main page or asp content page? As I said, I already installed the jquery dependency files, still getting an error like " Uncaught TypeError: this.container.find(...).first is not a function " in the selected.jquery.js file.
Is there an error with my code? Please suggest possible solutions. Thanks!!!
user4221591
source share