i have a set of aspx page & its associated controller. now i want to add a js file for a aspx page. i'm not getting how to add and link to particular aspx page in MVC.
what is the easiest way to add and link for the particular aspx page.
Edit
i created a folder inside Scripts-->Views-->Controllername-->somejsfile.js file.
in site master, below the jquery scripts loading place, i added
<script src="/Scripts/Views/ControllerName/somejsfile.js?Version=<%=ConfigurationManager.AppSettings["ScriptVersion"]%>" type="text/javascript"></script>
Now i have added init function inside js like
var somejsfileNamescript= function () {
return {
Init: function () {
alert("Hello");
}
}
} ();
I want this to get executed when the page is loaded. This is the only one js file present in my application thanks