来自jquery AJAX的调用webmethod中的身份validation失败

在这里我从Jquery Ajax调用webmethod。在成功函数中,我看到有一个错误称为“Authentication Failed”

在这里,我有错误的图像 错误

我的WebMethod

[WebMethod,ScriptMethod] public static List GetAllUploadedFiles() { List UploadedFilesDetails = new List(); try { SqlCommand comGetAllFiles = new SqlCommand("SP_GetAllUploadedFiles", conDB); comGetAllFiles.CommandType = CommandType.StoredProcedure; if (conDB.State == ConnectionState.Closed) conDB.Open(); SqlDataReader rdr = comGetAllFiles.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(rdr); foreach (DataRow r in dt.Rows) { UploadedFilesDetails.Add(new UploadedFiles { Id = (int)r["Id"], UserId =(Guid)r["UserId"], FilePath = r["FilePath"].ToString(), Date =(DateTime) r["Date"] }); } } catch(Exception ee) { } finally { conDB.Close(); } return UploadedFilesDetails; } 

我的Ajaxfunction

  $(function () { LoadUploadFiles(); }); function LoadUploadFiles() { var url = ''; $.ajax({ url: url, type: "post", dataType: "json", contentType: "application/json; charset=utf-8", success: function (Result) { debugger; $.each(Result.d, function (key, value) { alert("y"); $("#uploaddata").append($("
").val (value.Id).html(value.FilePath)); }); }, error: function (e, x) { alert(x.ResponseText); } }); }

在我的Web.Config文件中

       

我找到了答案

只需在RouteConfig文件中的下面注释

  //settings.AutoRedirectMode = RedirectMode.Permanent;