Is it possible to create a javascript file with some C# variables? Something like this:
var foo = <%= CODE_VALUE.foo %>;
Or do I hav
You can not have this code inside the .js file because is not compile by asp.net and so is not translate the CODE_VALUE.foo
into code.
what you can do is to place this variables just before load this .js file that you won to use, and set them on any aspx or user control.
For example
alternative you can create a handler that read javascript files, include your custom variables and create a full javascript code as you like, and send it as javascript one.
Some relative: How to get asp.net client id at external javascript file