title: Can i put ASP.NET in Js file?
body: <p>I am doing an ajax "Post" action and i need to work out the URL of my action.</p>
  
  <p>To do this i am using </p>
  
  <pre><code>   var url = '&lt;%= Url.Action("Action", "Controller") %&gt;';
  </code></pre>
  
  <p>But this code lives in a rather large Js file that is loading into my MVC View. I dont want to move it all into my view as it is too big and will look a mess.</p>
  
  <p>I tried setting my JS include to runat="server" but this errors.</p>
  
  <pre><code>&lt;script runat="server" src="&lt;%: ResolveUrl("~/Scripts/Custom/MyScript.js")%&gt;" type="text/javascript" &gt;&lt;/script&gt;
  </code></pre>
  
  <p>Can this be done?</p>
  
  <p>Thanks,
  Kohan</p>