title: Url is undefined in JavaScript
body: <p>I am developing an application in which I am retrieving data from the database into GirdView. Now when any user clicks on the Get City, it should return the city name of that particular row.</p>
  
  <p><img src="https://i.stack.imgur.com/0TL0c.jpg" alt="enter image description here"></p>
  
  <p>But i am getting the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/7i8O5.jpg" alt="enter image description here"> </p>
  
  <p>Following is my script code:</p>
  
  <pre><code> &lt;script&gt;
      $(document).ready(function () {
          $("a").one("click", function (evt) {
              debugger;
              var stu_id = $(evt.target).closest("tr").children(":first-child").text();
              $.ajax({
                  type: "POST",
                  url: 'WebForm1.aspx/get_city',
                  data: "{'stuid':'" + stu_id +"'}",
                  async: false,
                  contentType: "application/json; charset=utf-8",
                  success: function (final) {
                      debugger;
                      $("#LblCity").append(final.d + "&lt;hr/&gt;");
                  },
                  error: function () {
                      debugger;
                      alert('error');
                  }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My WebForm1.aspx.cs page code:</p>
  
  <pre><code>[WebMethod]
      public static string Get_City(int stuid)
      {
          MyDatabaseEntities MyDb = new MyDatabaseEntities();
  
          var data = from db in MyDb.Students
                     where db.ID == stuid
                     select db.City;
          return data.SingleOrDefault().ToString();
      }
  </code></pre>