title: How can I bind Dictionary to a partial view in ASP.NET MVC 5 Razor template engine
body: <p>I have the following presentation class</p>
  
  <pre><code>public class CustomerReportPresentation
  {
      public ReportFormat ReportFormat { get; set; }
  
      public List&lt;Dictionary&lt;string, object&gt;&gt; Data { get; set; }
  }
  </code></pre>
  
  <p>In a controller I have the following code</p>
  
  <pre><code>CustomerReportPresentation customerReport = new CustomerReportPresentation();
  
  customerReport.Data = ReportModel.Get(); // This will return a list like this List&lt;Dictionary&lt;string, object&gt;&gt;
  
  customerReport.ReportFormat = ReportFormat.Tabular;
  
  return View(customerReport);
  </code></pre>
  
  <p>Now, in my corresponding view I have the following code</p>
  
  <pre><code>@model Project1.Areas.Test.Presentation.CustomerReportPresentation
  @{
      ViewBag.Title = "Index";
  }
  
  @if (Model.ReportFormat == Project1.Support.ReportsGenerator.Report.Contracts.ReportFormat.Summary)
  {
      @Html.Partial("~/Support/ReportsGenerator/Views/Summary.cshtml", Model.Data)
  }
  else
  {
      @Html.Partial("~/Support/ReportsGenerator/Views/Tabular.cshtml", Model.Data)
  }
  </code></pre>
  
  <p>I am passing the list to the partial view. Then each partial view will display the data differently. </p>
  
  <p>Here is my partial view </p>
  
  <pre><code>@model List&lt;Dictionary&lt;string, Object&gt;&gt;
  
  &lt;ul&gt;
      @foreach (var attributes in Model.Data)
      {
          &lt;li&gt;
              @foreach (var attribute in attributes)
              {
                  @attribute.Value; &lt;text&gt;   &lt;/text&gt;
  
              }
          &lt;/li&gt;
      }
  &lt;/ul&gt;
  </code></pre>
  
  <p>But when I run my project I get this error</p>
  
  <pre><code> Compiler Error Message: CS0103: The name 'model' does not exist in the current context
  </code></pre>
  
  <p>How can I fix this issue?</p>