title: Passing data from a dictionary as ViewData
body: <p>I have defined and initialized a dictionary in my Controller: </p>
  
  <pre><code>  Dictionary&lt;string,int&gt; injuryValues = new Dictionary&lt;string,int&gt;();
                  int i = 1;
                  foreach (var tmpRec in allRecords)
                  {
                      if (!injuryValues.ContainsKey(tmpRec.INJURY))
                      {
                          injuryValues.Add(tmpRec.INJURY, ++i);
                      }
                  }
  
                  ViewData["InjuryDictionary"] = injuryValues;
  </code></pre>
  
  <p>I want to access this dictionary in my View.  I understand that the ideal way to pass this data is through a ViewModel but for this instance, I need to pass this dictionary in a ViewData container.  How can I do this so that in my View I can access this dictionary?</p>
  
  <p>For example, In my View, use the dictionary along the lines of: </p>
  
  <pre><code> %&gt;
  
      Dictionary injuryList = ViewData["InjuryDictionary"] as Dictionary&lt;string,int&gt;; 
  
  &lt;%
  </code></pre>
  
  <p>What is the correct syntax for me to access this in the View as a View Data container? For my purposes I am  not using a viewmodel though I understand that this is an ideal option.</p>