title: @html.DropDown ASP MVC and Select2 multiselect
body: <p>I have an <code>@Html.DropDownList</code> added to my view, the data for this dropdown is passed as a property in a ViewModel. How do I add Select2 Multiselect plugin onto this dropdownlist.</p>
  
  <pre><code>@Html.DropDownList("ValueId", new SelectList(item.Values, "Id", "Name"), new { @class = "values js-example-basic-multiple", @multiple ="multiple", @id="dropDown"}) | @Html.ActionLink("Delete", "Delete", new { id=item.Id })`
  </code></pre>
  
  <p>JQuery:</p>
  
  <pre><code>$('#dropDown').select2();
  </code></pre>
  
  <p>After Page is Rendered:</p>
  
  <pre><code> `&lt;select class="values js-example-basic-multiple" data-val="true" data-val-number="The field ValueId must be a number." data-val-required="The ValueId field is required." id="dropDown" multiple="multiple" name="ValueId"&gt;&lt;option value="4"&gt;M&lt;/option&gt;
  </code></pre>
  
  <p>8
  Red
  `</p>
  
  <p>Scripts:</p>
  
  <pre><code>`&lt;script src="/Content/jquery-3.1.1.min.js"&gt;&lt;/script&gt;`
  </code></pre>
  
  <p><code>&lt;link href="/Content/bootstrap.min.css" rel="stylesheet"/&gt;</code></p>
  
  <p><code>&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" /&gt;</code>
  <code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"&gt;&lt;/script&gt;</code></p>
  
  <p>UPDATE: I found the error. I was adding a new instance of JQuery to my page, and I forgot that my shared_layout page already has an instance of JQuery added.</p>