title: The type name 'Models' does not exist in the type 'System.Web.Helpers.Chart'
body: <p>I am getting error :  The type name 'Models' does not exist in the type 'System.Web.Helpers.Chart'</p>
  
  <p>Please help me in resolving this. Here is the code developed with mvc and razor syntax:</p>
  
  <p>Model</p>
  
  <pre><code>  using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
  
    namespace Chart.Models
    {
              public class FooBarModel
              {
                  public IEnumerable&lt;SelectListItem&gt; Locations { get; set; }
              }
    }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>        using Chart.Models;
          using System;
          using System.Collections.Generic;
          using System.Linq;
          using System.Web;
          using System.Web.Mvc;
  
          namespace Chart.Controllers
          {
              public class FooController : Controller
              {
                  //
                  // GET: /Foo/
  
                  public ActionResult Index()
                  {
                      var locations = new[]
                      {
                          new SelectListItem { Value = "US", Text = "United States" },
                          new SelectListItem { Value = "CA", Text = "Canada" },
                          new SelectListItem { Value = "MX", Text = "Mexico" },
                      };
  
                      var model = new FooBarModel
                      {
                          Locations = locations,
                      };
  
                      return View(model);
                  }       
              }
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bOQo1.png" alt="enter image description here"></p>
  
  <p>View Code:</p>
  
  <pre><code>        @model Chart.Models.FooBarModel             // intellisense shows error on this line as well
  
          @{
              Layout = null;
          }
  
          &lt;!DOCTYPE html&gt;
  
          &lt;html&gt;
          &lt;head&gt;
              &lt;meta name="viewport" content="width=device-width" /&gt;
              &lt;title&gt;Index&lt;/title&gt;
              &lt;script&gt;
                  var locations = @Html.Raw(Json.Encode(Model.Locations));
              &lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;div&gt;        
              &lt;/div&gt;
          &lt;/body&gt;
          &lt;/html&gt;
  </code></pre>