title: Use c# variable in Jquery
body: <p>I have c# variable <code>check</code> that I want to use in my jquery if condition. But I am getting error </p>
  
  <blockquote>
    <p>Uncaught ReferenceError: DGSCRM is not defined</p>
  </blockquote>
  
  <p>where <code>DGSCRM</code> is the value present in my c# variable <code>check</code>. </p>
  
  <pre><code>@{
      string check = Model.ChangeAddress.ControllerName;
  }
  &lt;script type=text/javascript&gt;
      $(document).ready(function () 
      {
      if(@check == "DGSCRMAPI")
      {
          $('#logo').hide();
      }
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Is it the right approach to mix c# and jquery code in views?</p>