title: ASP.NET MVC - Razor and JavaScript
body: <p>How can I put javascript inside <code>if</code> block?</p>
  
  <pre><code>@if(TempData["notification-message"] != null) {
          $('#notification').jnotifyAddMessage({
              text: '@TempData["notification-message"]',
                  permanent: false
                              });
  }
  </code></pre>
  
  <p>I'm getting <code>bad compile constant value</code>.</p>