title: How to set javascript variable from a C# variable in asp.net?
body: <p>How to set a C# variable to JavaScript array variable which is array.
  Following <code>choices</code> is array variable.<code>m_lines</code> is c# array variable.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
       $(document).ready(function () {
                   term = term.toLowerCase();
                   var choices = [];
                    choices = '&lt;%= m_lines %&gt;';
                   //var choices = ['aaaab', 'ActionScript', 'AppleScript', 'Asp', 'Assembly', 'BASIC', 'Batch', 'C', 'C++', 'CSS', 'Clojure', 'COBOL', 'ColdFusion', 'Erlang', 'Fortran', 'Groovy', 'Haskell', 'HTML', 'Java', 'JavaScript', 'Lisp', 'Perl', 'PHP', 'PowerShell', 'Python', 'Ruby', 'Scala', 'Scheme', 'SQL', 'TeX', 'XML'];
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My actual requirement is to read a large text file (size approx 3 MB) and assign it to a JavaScript array variable. I'm not able to read file from client side and assign it to JavaScript variable, so reading at server side and trying it to assign to client side variable.
  each line of file is being used as array item.</p>