title: Microsoft JScript runtime error: '$' is undefined error message trying to use jquery with ASP.NET
body: <p>I keep getting the following error message: 
  Microsoft JScript runtime error: '$' is undefined</p>
  
  <p>I've included the jquery ui js file like so: </p>
  
  <pre><code>      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
           &lt;head runat="server"&gt;
           &lt;title&gt;jquery Test Page&lt;/title&gt;
            &lt;script src="@Url.Content("~/Scripts/jquery-1.4.1.js")" type="text/javascript"&gt;&lt;/script&gt;
  
           &lt;script src="@Url.Content("~/Scripts/jquery-ui-1.8.11-min.js")" type="text/javascript"&gt;&lt;/script&gt;
  
           &lt;script&gt;
                $(function () {
                $('#startdate').datepick({ dateFormat: 'dd/mm/yyyy' });
                });        
           &lt;/script&gt;
           &lt;/head&gt;
          &lt;body&gt;
             &lt;form id="form1" runat="server"&gt;
               jquery date picker test: &lt;asp:TextBox ID="startdate" runat="server"&gt;&lt;/asp:TextBox&gt;
             &lt;/form&gt;
          &lt;/body&gt;
          &lt;/html&gt;
  </code></pre>
  
  <p>I think the problem is with the URL.CONTENT include - the compiler is complaining that it can't find the js files in the Url.Content line.  But i can see them in my solution folder - they are definitely included in the Scripts folder.  I think its my quotes but I can't figure out what it is. I've tried changing the actual file name inside the Url.Contents to have single quotes instead of double quotes.  But that didn't resolve the problem. I've also tried no quotes.</p>
  
  <p>Perhaps you can see what I'm missing - i'm sure its something simple that i'm overlooking. </p>