title: How to Put Javascript into an ASP.NET MVC View
body: <p>I'm really new to ASP.NET MVC, and I'm trying to integrate some Javascript into a website I'm making as a test of this technology.</p>
  
  <p>My question is this: <strong>how can I insert Javascript code into a View?</strong></p>
  
  <p>Let's say that I start out with the default ASP.NET MVC template. In terms of Views, this creates a Master page, a "Home" View, and an "About" view. The "Home" View, called Index.aspx, looks like this:</p>
  
  <pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %&gt;
  
  &lt;asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"&gt;
      Home Page
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"&gt;
      &lt;h2&gt;&lt;%= Html.Encode(ViewData["Message"]) %&gt;&lt;/h2&gt;
      &lt;p&gt;
          To learn more about ASP.NET MVC visit &lt;a href="http://asp.net/mvc" title="ASP.NET MVC Website"&gt;http://asp.net/mvc&lt;/a&gt;.
      &lt;/p&gt;
      &lt;p&gt;Welcome to this testing site!&lt;/p&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Adding a <code>&lt;script&gt;</code> tag here didn't work. Where and how should I do it?</p>
  
  <p>P.S.: I have a feeling I'm missing something very basic... Thanks in advance!</p>