Click here to Skip to main content
15,881,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using Chosen Jquery[^]within my application for a dropdownlist. Unfortunately if doesn't work when the dropdownlist is in updatepanel.

I know their is some conflicts between the scripts. But Unable to trace it out.
Any help is appreciated.

My Code is

C#
 <script src="/js/jquery-1.11.2.js" type="text/javascript"></script> 
<link href="../css/chosen.css"  rel="stylesheet" />
     <script src="../js/chosen.jquery.js" type="text/javascript"></script>
.
.
.

<asp:UpdatePanel ID="upMain" runat="server">
   <ContentTemplate>

 <asp:DropDownList ID="DropDownList1" CssClass="form-control chosen" multiple runat="server">
<asp:ListItem Text="Select Course" Value="0" CssClass="form-control" runat="server"/>
<asp:ListItem Text="core java" Value="1" CssClass="form-control" runat="server" /> <asp:ListItem Text="C" Value="2" CssClass="form-control" runat="server" /> <asp:ListItem Text="C++" Value="3" CssClass="form-control" runat="server" />  <asp:ListItem Text="C#" Value="4" CssClass="form-control" runat="server" />   </asp:DropDownList>

   </ContentTemplate>
 </asp:UpdatePanel>
.
.
.

 <script>
 jQuery(document).ready(function mchoose() { jQuery(".chosen").data("placeholder", "Select Frameworks...").chosen();});
    </script>


It works fine when I place the dropdownlist outside the update panel.

Any Help is appreciated.!!!
Posted
Comments
Madhu Nair 13-Nov-17 7:44am    
Hi Vamsi,

Is this issue of your's resolved? Can you please share the solution if solved?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900