title: ajax call not working in external js file
body: <p>I have a Registration page having only UserName and Password field. I want to submit new User Details on Click event of Submit button. PLease tell me how do I use ajax call using jquery. I have defined Insert function on button click in ASP.net. But it's not working.</p>
  
  <pre><code>function Insert() {
      alert("Insert");
  
      var uname = $('#txtRUserName').val();
  
      alert(uname)
      var password = $('#txtRPassword').val();
      $.ajax({type: "POST",
              url: "login.aspx/Insert",
              data: "{'uname:'" + uname + ",'password:'" + password + "}",
              datatype: "text/html",
              cache: false,
              async: false,
              contentType: "text/html",
              success: function processData(r) {
                  var myItem = r.d.split('#');
                  alert(myItem)
              }
              //error: errorAlert
          });
      alert("jqajax")
  }
  </code></pre>