title: Runtime error Javascript is undefined
body: <p>As some background I've come via VB6 then VB.Net and am now trying out Bootstrap/MVC with C# so excuse the queries... I've SO searched and been on YouTube as well but a struggling a little. I've my approach is wrong do tell me! </p>
  
  <p><strong>Aim:</strong>
  Stored procedure to run and, in this case, confirm if the username and password are correct. I'll be wanting to add in insert/edit to later Stored Procedures.</p>
  
  <p><strong>Issue:</strong> 
  When I run the code on the website I get no error or result. In debug mode I get:</p>
  
  <pre><code>Unhandled exception at line 133, column 5 in http://localhost:49647/Account/Login
  
  0x800a1391 - JavaScript runtime error: '$' is undefined
  </code></pre>
  
  <p><strong>Thoughts</strong>
  I am not a JS programmer but would assume I'd need to add something to 'Dim' the value in some way? Looking at <a href="https://stackoverflow.com/questions/15948763/0x800a1391-javascript-runtime-error-jquery-is-undefined">0x800a1391 - JavaScript runtime error: &#39;jQuery&#39; is undefined</a> I might need to call something? </p>
  
  <p><strong>User.cs</strong></p>
  
  <pre><code>using System;
  using System.Data.SqlClient;
  using System.Data;
  using System.Configuration; 
  
  namespace Login.BL
  {
      public class User
      {
          public int UserID { get; set; }
          //[Required]
          public int Username { get; set; }
          //[Required]
          public int UserPassword { get; set; }
  
      }
      public class UserBusinessLogic
      {
          string conStr = ConfigurationManager.ConnectionStrings["myTaylorWoodrowSQL"].ConnectionString;
          public int CheckUserLogin(User User)
          {
              //Check the user is valid!!!!
              using (SqlConnection conObj = new SqlConnection(conStr))
              {
                  SqlCommand comObj = new SqlCommand("retrieveUserByNameAndPassword", conObj);
                  comObj.CommandType = CommandType.StoredProcedure;
                  comObj.Parameters.Add(new SqlParameter("@Username", User.Username));
                  comObj.Parameters.Add(new SqlParameter("@Password", User.UserPassword));
                  conObj.Open();
                  return Convert.ToInt32(comObj.ExecuteScalar());
              }
          }
      }
  }
  </code></pre>
  
  <p>Extract from <strong>Login.cshtml</strong> I can post full code</p>
  
  <pre><code>&lt;script&gt; 
      $("#Login").click(function ()
      {
          var dataObject = { UserName: $("#UserName").val(), Password: $("#Password").val() };
          $.ajax({
              url:'@Url.Action("Login","User")',
              type:"POST",
              data: dataObject,
              datatype: "json",
              success: function(result)
              {
                  if(result.toString()=="Success")
                  {
                      alert(result);
                  }
                  else
                  {
                      alert(result);
                  }
              },
              error: function (result)
              {
                  alert("Error");
              }
          });
      })
  &lt;/script&gt;
  </code></pre>