In the asp.net mvc 3 application I have two views which have the same set of javascript functions. Javascript is identical so I want to reorganize this code and extract all the javascript code into .js file in order to include it in both chtml files.
The problem is that one of the javascript functions uses C# code in order to get some data from model. How can I insert C# code into the javascript(.js) file or how can I extract all this code into a separate chtml file and include it in both of the previous?
data-tags, or hidden values to consume in the script file.