title: How to make a select list item selected in asp.net mvc?
body: <p>I have the following code but it never selects the value I want. </p>
  
  <pre><code>     List&lt;SelectListItem&gt; list = new List&lt;SelectListItem&gt;();
       SelectListItem one = new SelectListItem() { Text = "MyTest", Value = "MyTest"};
       SelectListItem two= new SelectListItem() { Text = "Test2", Value = "Test2" };
  
       if (id == "MyTest")
       {
           one .Selected = true;
       }
       else
       {
           two.Selected = true;
       }
       list.Add(one);
       list.Add(two);
       ViewData["DDL"] = new SelectList(list, "value", "text");
  </code></pre>
  
  <p>So I am not sure what I am doing wrong</p>
  
  <p>in my view I have</p>
  
  <pre><code>&lt;%= Html.DropDownList("DDL") %&gt;
  </code></pre>