title: ViewData is not defined
body: <p>inside controller I'm checking state of some property and based on that I want to send on the view some flag. I decide to use ViewData for data.</p>
  
  <pre><code> if (model.MyProp == null)
   {
      ViewData["MyFlag"] = "yes"; // it doesn't need to be yes, basically if exist
   }
  </code></pre>
  
  <p>and inside razor view in embeded js script code</p>
  
  <pre><code>&lt;script&gt;
    if (ViewData["MyFlag"] != undefined) {
      alert('0');
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>on page render firebug console report me error</p>
  
  <blockquote>
    <p>ReferenceError: ViewData is not defined</p>
  </blockquote>
  
  <p>so what I'm doing wrong here?</p>