0

I have tried jQuery ui tabs selected event through ajax call, called my page methods .but its not triggered???

//my aspx page like i have declared jquery ui tabs like

<div id="tabs">
    <ul>
         <li><a href="#tabs-1">Hospital</a></li>
         <li><a href="#tabs-2">Treatment</a></li>
    </ul>
</div>

and my JS

<script type="text/javascript"> 
        $(function () {
            var $tabs = $("#tabs").tabs({
                select: function (e, ui) {
                    var thistab = ui.index;
                    $("#tabs-" + thistab).html(getCars(thistab));
                }
            });
        });
        function getCars(thistab) {
            switch (thistab) {
                case 0:  // case 0 calling my first method is Bindtab1
                    $.ajax({
                        type: "POST",
                        url: 'HospitalReg.aspx/Bindtab1',
                        data: '',
                        contentType: "application/json; charset=utf-8",
                        dataType: "json"
                    });

                case 1://case 0 calling my first method is Bindtab2
                    $.ajax({
                        type: "POST",
                        url: 'HospitalReg.aspx/Bindtab2',
                        data: '',
                        contentType: "application/json; charset=utf-8",
                        dataType: "json"
                    });
                break;
            }
        }
    </script>

  private void Bindtab1()// Method 1
    {
    }  
  private void Bindtab2() // Method 2
    {
    }
Guruprasad J Rao
  • 29,410
  • 14
  • 101
  • 200
Muthu
  • 165
  • 4
  • 18

0 Answers0