Is it possible to access a Model property in an external Javascript file?
e.g. In \"somescript.js\" file
var currency = \'@Model.Currency\';
alert(cu
Try JavaScriptModel ( http://jsm.codeplex.com ):
Just add the following code to your controller action:
this.AddJavaScriptVariable("Currency", Currency);
Now you can access the variable "Currency" in JavaScript.
If this variable should be available on the hole site, put it in a filter. An example how to use JavaScriptModel from a filter can be found in the documentation.