title: Can I pass the viewbag value to the jQuery in mvc2
body: <p>I need to pass the value to jQuery in the view using viewbag. What I want to achieve is pass the null or some value and then jQuery should hide or show the div depending on the value passed for instance something like below:</p>
  
  <pre><code>viewbag.testNumber = null;
   $('#showdiv').hide();
    $('viewbag.testNumber').value == someinteger{
  
      $("#showdiv").show();
      else
      $("#showdiv").hide();
  });
     &lt;div id="showdiv"&gt; Some Calculation &lt;/div&gt;
  </code></pre>
  
  <p>Also I want to disable the viewbag in the view if the value is null , because it gives null error </p>