[Solved] Calling WebMethod using jQuery Ajax Error: Authentication failed

ramco1917
 
on Sep 07, 2022 10:51 PM
1381 Views

Hi

WebMethod not getting Called

It is giving error 

{"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException

<script type="text/javascript">
     function BindData(e) {
         var currentRow = $(e).closest("tr");
         var Id = currentRow.find("td:eq(0)").text();
 
         document.getElementById('txtId').value = Id;
         $.ajax({
             type: "POST",
             url: "DraftedTrainingList.aspx/GetParticipants",
             data: '{id:"' + Id + '"}',
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             success: function (r) {
                 var ddlParticipant = $("[id*=ddlParticipant]");
                 ddlParticipant.empty().append('<option selected="selected" value="0">Select Participant</option>');
                 $.each(r.d, function () {
                     ddlParticipant.append($("<option></option>").val(this['Value']).html(this['Text']));
                 });
                 $('#modal_form_horizontal').modal("show");
             }
         });
     };
 </script>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download