Hi i have .net mvc application I deploy it on iss when i run it from iis it works fine but when I access the application from other machines using IP i got below error message in console
Access to XMLHttpRequest at 'http://localhost/EvaluationSystem/Students/GetList' from origin 'http://58.65.169.181' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
basically i am calling my method in razor view with http://localhost/EvaluationSystem/Student/GETLIST

Sachin SinghRank #66 · 26.2K reputationPosted May 20, 2021, 5:26 AM EDT
Rijwan AnsariRank #82 · 24.2K reputationPosted May 21, 2021, 12:25 PM EDT
Salman BegRank #284 · 8.8K reputationPosted May 20, 2021, 5:07 AM EDT
Arnab MukherjeeRank #879 · 2.5K reputationPosted May 20, 2021, 6:46 AM EDT
Pranam BhatRank #500 · 4.9K reputationPosted May 20, 2021, 7:04 AM EDT
Mark TaborRank #914 · 2.3K reputationPosted May 20, 2021, 9:37 AM EDT
Mark TaborRank #914 · 2.3K reputationPosted May 20, 2021, 9:51 AM EDT
$(document).ready(function () {
$("#tblStudents").DataTable({
"ajax": {
"url": "http://localhost/EvaluationSystem/Students/GetList",
"type": "POST",
"processing": true,
"serverSide": true,
"datetype": "json"
},