You cannot have this code inside a .js file because it is not compiled by asp.net and therefore does not translate the code CODE_VALUE.foointo code.
what you can do is put these variables right before loading this .js file that you won for use, and set them on any aspx or user control.
for instance
<script>
var foo = <%=CODE_VALUE.foo%>;
<script>
<script type="text/javascript" src="fileToUseTheFoo.js">
</script>
, javascript, javascript javascript.
: asp.net javascript