title: Calling a JavaScript function from another view
body: <p>I'm new to ASP.NET MVC and was wondering where JS functions for the views go. I have a table element in a view that displays the @RenderBody part of _Layout, and in it's th elements, I have -</p>
  <pre><code>&lt;th id=&quot;one&quot; oncontextmenu = &quot;return menu(this)&quot;&gt;label one&lt;/th&gt;
  </code></pre>
  <p>Where should the function main(..) be located? Can it be in the script tag on the _Layout page or are individual view pages allowed to have their own script tags where this should go?</p>
  <p>I've worked in WebForms before, so moving to MVC, I'm having trouble visualizing how to put all the pieces together. Help please!</p>