title: How to pass generic list of values to external js file from controller/view in ASP.NET MVC
body: <p>The file name is called <code>clik.js</code> here I have to access some values from controller/view</p>
  <p>Using view I have tried this code:</p>
  <pre><code>&lt;head&gt;
      @if (ViewBag.status != null)
      {
         
      &lt;script type=&quot;text/javascript&quot;&gt;
  
                  var tagAccess='@ViewBag.status[0]';
      &lt;/script&gt;
       &lt;script src=&quot;~/JavaScript/click.js&quot;&gt;&lt;/script&gt;
  
      }
  &lt;/head&gt;
  </code></pre>
  <p>Using this code, I could get single value in js file. But I have to get all values</p>
  <pre><code>//var tagAccess='@ViewBag.status';  
  </code></pre>
  <p>If I write the code like this, I didn't get any output</p>