title: How do jQueryUI tabs on click event trigger to page method, then values assign to controls in C# asp.net?
body: <p>In an Aspx page, I have declared jQueryUI tabs like this:</p>
  
  <pre><code>&lt;div id="tabs" style="margin: 0 auto; margin-bottom: 2px;"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="#tabs-1" onclick="gettabvalues(1);"&gt;Hospital&lt;/a&gt;&lt;/li&gt;/*on click event am calling java script method through my page methods .but web methods having static key word so am not able to assign value to asp controls*/
          &lt;li&gt;&lt;a href="#tabs-2" onclick="gettabvalues(2);"&gt;Treatment &lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My JavaScript:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  // based on tab selection switch condition will execute page methods
  function gettabvalues(thistab) {// parameter tab id - thistab
      switch (thistab) {
          case 1:
              $.ajax({
                  type: "POST",
                  url: 'HospitalRegistrationStep2.aspx/Bindtab1',
                  data: '{tabID: ' + thistab + '}',
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function (response) {
                      alert(response.d);
                  },
                  failure: function (response) {
                      alert(response.d);
                  }
              });
              break;
          case 2:
              $.ajax({
                  type: "POST",
                  url: 'HospitalRegistrationStep2.aspx/Bindtab2',
                  data: '{tabID: ' + thistab + '}',
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function (response) {// Success message will throw this method.
                      alert(response.d);
                  },
                  failure: function (response) {
                      alert(response.d);// error message
                  }
              });
              break;
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  
  
  <pre><code> private static void Bindtab1(int tanID)
   {
         TestRetrieveRequest testRetrieveRequest =new TestRetrieveRequest();
         TestRetrieveResponse testRetrieveResponse=GetDetails(TestRetrieveRequest);
         txtAccreditation.Text = TestRetrieveResponse.TestList[0].Accreditation ;
         txtName.Text = TestRetrieveResponse.TestList[0].Name ;
         txtAGE.Text = TestRetrieveResponse.TestList[0].Age ;
         txtMobile.Text = TestRetrieveResponse.TestList[0].Mobile ;
         gvTreatment.DataSource = TestRetrieveResponse.TreatmentList;
         gvTreatment.DataBind();
   }
  </code></pre>