title: Why am I getting a no overload for method "DropDownListFor'?
body: <p>I am learning MVC and coding my own simple application. A calculator application. Basically, I want to have the user enter two numbers then use a drop down menu to decide what operation they will conduct on the numbers. Unlike previous things I have been working on. The code below (except for the hint I found at a blog post for doing a drop down), is completely my own. </p>
  
  <h2>Problem</h2>
  
  <p>I was surprised at how nontrivial a drop down menu would end up being. So I found this nice <a href="http://odetocode.com/blogs/scott/archive/2013/03/11/dropdownlistfor-with-asp-net-mvc.aspx" rel="nofollow noreferrer">post</a>. I modified this code to my solution and I get the following error: </p>
  
  <p>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
  
  <pre><code>Compiler Error Message: CS1501: No overload for method 'DropDownListFor' takes 1 arguments
  
  Source Error:
  
  
  Line 18:         &lt;p&gt;First Number : @Html.TextBoxFor(x =&gt; x.Number1) &lt;/p&gt;
  Line 19:         &lt;p&gt;Second Number: @Html.TextBoxFor(x =&gt; x.Number2)&lt;/p&gt;
  Line 20:         &lt;p&gt;Select Operand: @Html.DropDownListFor(x=&gt;x.OperationItems)&lt;/p&gt;
  Line 21:         &lt;input type="submit" value="Enter" /&gt;
  Line 22:     }
  </code></pre>
  
  <h2>Code</h2>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class CalculatorData
  {
      private readonly List&lt;CalculatorOperations&gt; ops = new List&lt;CalculatorOperations&gt;();
  
      //Does this have to be public or not? 
      public string Number1 { get; set; }
      public string Number2 { get; set; }
  
      public IEnumerable&lt;SelectListItem&gt; OperationItems
      {
          get { return new SelectList(ops); }
      }
      //Database context connector? 
  
      public CalculatorData()
      {
          ops.Add(new CalculatorOperations { Name = "Add" });
          ops.Add(new CalculatorOperations { Name = "Subtract" });
          ops.Add(new CalculatorOperations { Name = "Multiply" });
          ops.Add(new CalculatorOperations { Name = "Divide" });
      }
  
  }
  
    public class CalculatorOperations
    {
          public string Name { get; set; }
  
    }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public class CalculatorController : Controller
  {
      //
      // GET: /Calculator/
      public ActionResult Index()
      {
          CalculatorData cd = new CalculatorData();
  
          return View(cd);
      }
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>@model MVCalculatorDemo.Models.CalculatorData
  
  @{
      Layout = null; 
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;RsvpForm&lt;/title&gt;
  &lt;/head&gt;
  &lt;h2&gt;Calculator&lt;/h2&gt;
  &lt;body&gt;
      @using (Html.BeginForm())
      {
          &lt;p&gt;First Number : @Html.TextBoxFor(x =&gt; x.Number1) &lt;/p&gt;
          &lt;p&gt;Second Number: @Html.TextBoxFor(x =&gt; x.Number2)&lt;/p&gt;
          &lt;p&gt;Select Operand: @Html.DropDownListFor(x=&gt;x.OperationItems)&lt;/p&gt;
          &lt;input type="submit" value="Enter" /&gt;
      }
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Attempts</strong></p>
  
  <ol>
  <li>I think the overload method is the big clue. Thus, I suspect my method OperationItems is messed up in my model. That being said, I'm not sure what it would be? </li>
  <li><a href="https://stackoverflow.com/questions/25490764/issues-populating-mvc-html-dropdownlist">This</a>. Except I am thinking my model doesn't fit that problem. </li>
  </ol>
  
  <p>Pardon any stupid mistakes. I think I am close? Webdev is making my head spin at the moment. </p>