I have a code here using Loudev multiselect
I’m using a content page in C# and it’s not working properly for me.
Is there anything wrong with my code?
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script src="Scripts/jquery.multi-select.js" type="text/javascript"></script>
<link href="Styles/multi-select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$('#countries').multiSelect()
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<select multiple="multiple" id="countries" name="countries[]">
<option value="fr">France</option>
<option value="uk">United Kingdom</option>
<option value="us">United States</option>
<option value="ch">China</option>
</select>
</asp:Content>
First check, did you referenced jquery library file
jquery.jsin master page or not? If not then include it in master page or in default page beforejquery.multi-select.js.If you referenced correctly than change your code to
Call multiselect when dom ready.
You are just selecting an element before it to load in dom.
Hope It will solve your issue.