title: Partial View returning null model
body: <p>Now I bet this is a problem that happens often, I just can't seem to find anything related to it, or notice myself what is wrong with it. The view provided at bottom always returns null on <code>foreach</code> line.</p>
  
  <p>I'm making a simple currency list.</p>
  
  <p>Model:</p>
  
  <pre><code>public class Currency
  {
      public int ID { get; set; }
      public string Name { get; set; }
      public string Sign { get; set; }
      public float BuyValue { get; set; }
      public float MidValue { get; set; }
      public float SellValue { get; set; }
  
      public string CurrencyIcon { get; set; }
  
      [DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
      public DateTime DateCreated { get; set; }
  }
  </code></pre>
  
  <p>And it should be posted as partial view, on several different ways so to say. For example, partial view that will get all of them (for today), and partial view that will get random 6 (also for today).</p>
  
  <p>I'm doing the first part now, all of them, for today.</p>
  
  <p>Controller</p>
  
  <pre><code>public ActionResult FrontPagePartial()
  {
      DateTime today = DateTime.Now.Date; //i'm filtering it by date only
      var currencies = db.Currencies.Where(c =&gt; c.DateCreated.Equals(today));
  
      return View(currencies);
  }
  </code></pre>
  
  <p>I've checked the filtering it's working correctly. So my view goes like this:</p>
  
  <pre><code>@model IEnumerable&lt;CurrencyList.Models.Currency&gt;
  
  &lt;div id="currencyList_Partial"&gt;
      &lt;div id="bg_currencyList_Partial"&gt;
          &lt;img src="@Url.Content("~/Content/Resources/img.png")" /&gt;
      &lt;/div&gt;
      &lt;div id="header_currencyList_Partial"&gt;
          &lt;div style="padding: 10px;"&gt;
              &lt;p style="font-size: 18px;"&gt;
                  Currency List&lt;br /&gt;
                  &lt;span class="header_currencyList_Partial_Day"&gt;FOR TODAY&lt;/span&gt;
              &lt;/p&gt;
              &lt;p class="header_currencyList_Partial_Link" &gt;
                  &lt;a href="#"&gt;DETAILS &gt;&lt;/a&gt;
              &lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="table_currencyList"&gt;
              @foreach (var item in Model)
              { 
                  &lt;table&gt;
                      &lt;tr&gt;
                          &lt;td style="text-align: center;"&gt;&lt;img src='@item.CurrencyIcon' title='@item.Sign' /&gt;&lt;p style="font-size: small;"&gt;@Html.DisplayFor(modelItem =&gt; item.Name)&lt;/p&gt;&lt;p&gt;@Html.DisplayFor(modelItem =&gt; item.Sign)&lt;/p&gt;&lt;/td&gt;
                          &lt;td style="text-align: center;"&gt;@Html.DisplayFor(modelItem =&gt; item.BuyValue)&lt;/td&gt;
                          &lt;td style="text-align: center;"&gt;@Html.DisplayFor(modelItem =&gt; item.MidValue)&lt;/td&gt;
                          &lt;td style="text-align: center;"&gt;@Html.DisplayFor(modelItem =&gt; item.SellValue)&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              }
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Parent view</p>
  
  <pre><code>@{
      ViewBag.Title = "Currency List Home Page";
  }
  
  @section HeadSection{
      &lt;link rel="stylesheet" href="@Url.Content("~/Content/layerslider.css")" type="text/css" media="screen" /&gt;
      &lt;link rel="stylesheet" href="@Url.Content("~/Content/defaultskin/skin.css")" type="text/css" media="screen" /&gt;
      &lt;noscript&gt;
          &lt;link rel="stylesheet" href="@Url.Content("~/Content/noscript.css")" type="text/css" media="screen" /&gt;
      &lt;/noscript&gt;
  }
  
  @section ScriptSection{
      &lt;script src="@Url.Content("~/Scripts/jqueryui.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/plugins.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/page.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/layerslider.kreaturamedia.jquery.js")" type="text/javascript"&gt;&lt;/script&gt;
  }
  &lt;div id="content"&gt;
      &lt;div id="statusbar"&gt;&lt;/div&gt;
      &lt;div id="slider"&gt;
          &lt;div id="layerslider"&gt;
              &lt;div class="ls-layer" style="slidedelay: 3000"&gt;
                  &lt;img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide1_layer1.png")" alt="layer" /&gt;
                  &lt;img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0; top: 247px;/*easingin: easeOutElastic*/" /&gt;
                  &lt;img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px;left: 15px; easingin: easeOutElastic " /&gt;
              &lt;/div&gt;
              &lt;div class="ls-layer" style="slidedelay: 3000"&gt;
                  &lt;img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide2_layer1.png")" alt="layer" /&gt;
                  &lt;img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0; top: 247px;/*easingin: easeOutElastic*/" /&gt;
                  &lt;img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px;left: 15px;easingin: easeOutElastic " /&gt;
              &lt;/div&gt;
              &lt;div class="ls-layer" style="slidedelay: 3000"&gt;
                  &lt;img class="ls-bg" src="@Url.Content("~/Content/images/slider_gallery/slide3_layer1.png")" alt="layer" /&gt;
                  &lt;img class="ls-s2" src="@Url.Content("~/Content/images/slider_gallery/behind_text_layer.png")" alt="sublayer" style="durationin: 0;top: 247px;" /&gt;
                  &lt;img class="ls-s3" src="@Url.Content("~/Content/images/slider_gallery/text_layer1.png")" alt="sublayer" style="durationin: 2000; top: 255px; left: 15px; easingin: easeOutElastic " /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="converter"&gt;
          &lt;h2&gt;CONVERTER&lt;/h2&gt;
          &lt;p class="shadowedText"&gt;
              VALUE:
          &lt;/p&gt;
          &lt;p&gt;
              &lt;input type="text" id="tb11" class="tb11" /&gt;
          &lt;/p&gt;
          &lt;p class="shadowedText"&gt;
              FROM CURRENCY
          &lt;/p&gt;
          &lt;div class="select1 select1p"&gt;
                  &lt;select id="select1"&gt;
                      &lt;option&gt;EUR - EURO&lt;/option&gt;
                      &lt;option&gt; $  - DOLLAR&lt;/option&gt;
                  &lt;/select&gt;
              &lt;span class="selectArrow"&gt;&lt;img src="@Url.Content("~/Content/images/select_arrows.png")" /&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;p class="shadowedText"&gt;
              TO CURRENCY
          &lt;/p&gt;
          &lt;div class="select1 select1p"&gt;
                  &lt;select id="select2"&gt;
                      &lt;option&gt; $ - EURO&lt;/option&gt;
                      &lt;option&gt; EURO  - DOLLAR&lt;/option&gt;
                  &lt;/select&gt;
              &lt;span class="selectArrows"&gt;&lt;img src="@Url.Content("~/Content/images/select_arrows.png")" /&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="select1p addMargin"&gt;
              &lt;span class="boldResult"&gt;100 EUR = 11710.55 $&lt;/span&gt;&lt;br /&gt;
              &lt;span class="lightResult"&gt;100 $ = 0.84882 EUR&lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;div id="lowerContent"&gt;
      &lt;div id="blog"&gt;&lt;img src="@Url.Content("~/Content/images/vesti.png")" /&gt;&lt;/div&gt;
  
  
      //This is where Partial View is rendered
      &lt;div id="listC"&gt;@Html.Partial("FrontPagePartial")&lt;/div&gt;
  
  
  &lt;/div&gt;
  
  &lt;div id="portals"&gt;
  
  &lt;/div&gt;
  </code></pre>