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

Ajax undefined value in PHP – Jquery ajax

When I call the function I always get an undefined value, I don't understand what can ruin it. You are logged in as undefined, Error undefined Ajax script: function Submit() { console.log('asd') $.ajax({ url: "Server.php", type: "POST", dataType: "json", data:…

VIEW QUESTION

How to pass multiple parameters with Ajax – Jquery ajax

<select name="docname" class="form-control" id="docname" required> <option Value="">Please Choose Doctor</option> <?php foreach($data as $crow){ echo "<option value='$crow->name'>$crow->name</option>"; } ?> </select> <input type="date" name="bdate" class="form-control txtDate" id="txtHint" required> <div class="form-group" id="txtHint1"></div> <script> $(document).ready(function(){ $('#docname').on('change',function(){ var doc_id=this.value; $.ajax({ url:"subcat.php", type:"POST", data:{ doc_id:doc_id },…

VIEW QUESTION
Back To Top
Search