skip to Main Content

Ajax Post in Asp.net Core in .Net 6 is not working in Action method – Jquery ajax

I am making an ajax call in cshtml like below: $(document).ready(function(){ $('.dl-dir-list').click(function(e){ console.log($(e.target).data('path')); console.log(JSON.stringify({path: $(e.target).data('path')})); $.ajax({ type: "POST", url: '@Url.Action("GetFiles")', data: JSON.stringify({path: $(e.target).data('path')}), dataType: "json", contentType: "application/json; charset=utf-8", success: function (response) { console.log(response); }, error: function () { alert("Error while…

VIEW QUESTION
Back To Top
Search