title: Processing ASP.NET expressions inside an external Javascript file
body: <p>What's the best practice for using <a href="http://msdn.microsoft.com/en-us/library/d5bd1tad.aspx" rel="nofollow noreferrer">ASP.NET expressions</a> inside an external Javascript file?</p>
  
  <p>I'm using the ASP.NET MVC framework currently and need to do something similar to the following from within an external JS reference:</p>
  
  <pre><code>jQuery(document).ready (function () {
      jQuery ("#element&lt;%= Model.IdFromAThing %&gt;").click (... blah ...
  });
  </code></pre>
  
  <p>I <em>could</em> move this into the View, granted, but I'd like to keep it separate.</p>
  
  <p>P.S.</p>
  
  <p>One of the advantages of doing this is I can re-use the same JS file in many places, I don't really want to repeat initialisation logic in each view (considering it'll be identical).</p>