title: Unable to call web service 2nd time From jQuery
body: <p>I am unable to call web service 2nd time from jQuery function code is here.</p>
  
  <p>Page:</p>
  
  <pre><code>&lt;telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"&gt;
  &lt;script type="text/javascript"&gt;
  function getCityByPinCode() {
          var path = '&lt;%=ConfigurationManager.AppSettings["AutoComplete"].ToString() %&gt;';
          $.ajax({
              type: "POST",
              url: "" + path + "/CityBasedOnPinCode",
              data: "{pincode: '" + $("#&lt;%=ntxbPostCode.ClientID%&gt;").val() + "'}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: OnSuccess,
              error: OnError
          });
      }
      function OnSuccess(data, status) {
          var city = document.getElementById('&lt;%= tbxCity.ClientID %&gt;');
          var val1 = data.d;
          document.getElementById("ContentPlaceHolder1_CompanyDetails1_tbxCity").value = val1;
      }
  
      function OnError(request, status, error) {
          alert(request.statusText);
      }
  &lt;/script&gt;
  &lt;/telerik:RadCodeBlock&gt;
  &lt;body&gt;
   &lt;telerik:RadNumericTextBox ID="ntxbPostCode" runat="server" DataType="System.Int32"
      MaxLength="4" TabIndex="4" Width="95%" DecimalDigits="0" ClientEvents-OnValueChanged="getCityByPinCode()"&gt;
   &lt;/telerik:RadNumericTextBox&gt;
  
   &lt;asp:TextBox ID="tbxCity" runat="server" Width="95%" TabIndex="5"&gt;&lt;/asp:TextBox&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Web service:</p>
  
  <pre><code>public string CityBasedOnPinCode(string pincode)
  {
      int pcode = 0;
      int.TryParse(pincode, out pcode);
      List&lt;usp_CityBasedOnPinCodeResult&gt; lstCity = new CityDA().CityBasedOnPincode(pcode);
      return lstCity[0].CityName.ToString();
  }
  </code></pre>
  
  <p>I want to fill city textbox on the base of pincode entered.So when User Enters pincode,he/she gets city name automatically.When I put value of pincode predefined it gives me perfect result but when i am entering new value i got error as follows</p>
  
  <blockquote>
    <p>Microsoft JScript runtime error: Object expected.</p>
  </blockquote>
  
  <p>Note that if i have value of pincode in textbox  at page load time(edit time) Then i am getting proper value but not getting value after changing value of textbox.
  jQuery is included in masterpage. so not included here.</p>