title: Asp.net Core, set multiple selected values in Razor Page
body: <p>So, I am trying to create a multi-select dropdown list and I want to set some default selected values in it. <br>I get the values and store them in an array of strings containing the values in each one.<br> I tried to set them as 1 string and it didn't work, tried setting them as an array of strings and it didn't work as well.</p>
  <p>Here is the code:</p>
  <pre><code>&lt;select name=&quot;FacultyList&quot; multiple class=&quot;sel form-control&quot; asp-for=&quot;Faculties&quot; 
  id=&quot;uniFaculties&quot; asp-items=&quot;@(new SelectList(facultyList,&quot;Name&quot;,&quot;Name&quot;,@selectedFaculties))&quot;&gt;
  &lt;/select&gt; 
  </code></pre>
  <p><strong>facultyList</strong> is a list of values I get from and api.  <br>
  <strong>selectedFaculties</strong> is an array of strings that contains the selected values.</p>
  <p><strong>Note:</strong> I'm using the Chosen jQuery library as well if that makes a difference.</p>