In here i call webmethod from Jquery Ajax.In the success function i saw there's a error called "Authentication Failed"
My 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; }
My Ajax Function
In my Web.Config file
Sagar Pandurang KapRank #606 · 4K reputationPosted Feb 12, 2019, 8:13 PM EST
In your App_Start folder, within your RouteConfig....
Comment out the following line or change its RedirectMode:
Sanwar RanwaRank #23 · 44.7K reputationPosted Feb 17, 2019, 10:14 PM EST