MVC - Show list of strings in DropDownList
<p>Based on this code (auto-generated Control/View code from Visual Studio):</p>

<pre><code>&lt;div class="form-group"&gt;
    @Html.LabelFor(model =&gt; model.Type, htmlAttributes: new { @class = "control-label col-md-2" })
    &lt;div class="col-md-10"&gt;
        @*Comment: Want to replace EditorFor to DropDownList("Banana, "Apple", "Orange"*@
        @Html.EditorFor(model =&gt; model.Type, new { htmlAttributes = new { @class = "form-control" } })*@
        @Html.ValidationMessageFor(model =&gt; model.Type, "", new { @class = "text-danger" })
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I would like to add something similar like:</p>

<pre><code>@Html.DropDownList("UserId", null, htmlAttributes: new { @class = "form-control" })
</code></pre>

<p>(also auto-generated code, but for <code>UserId</code>) instead of <code>@html.EditorFor...</code></p>

<p>I was able to see list of <code>UserName</code>(value = <code>Id</code>) from db via Controller:</p>

<pre><code>ViewBag.UserId = new SelectList(db.Users, "Id", "UserName", Test.UserId);
</code></pre>

<p>Now, I don't want that ViewBag read from database, instead I want it to list 3 different strings that I will use to let user to chose for indata(meaning, limit them to choice one of these 3 string instead writing it).</p>

<p>Strings I want it to list:</p>

<ul>
<li>"Banana"</li>
<li>"Apple"</li>
<li>"Orange"</li>
</ul>

<p>How do I do that?</p>