Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am creating a two layer application one layer is mvcweb and second layer is wcf services i am calling web layer to services its show me error 404 Not found below is my code please help me.

ajax code:

JavaScript
$(function () {
          $.ajax({
              type: "POST",
              contentType: "application/json; charset=utf-8",
              url: 'Employee.svc/GetEmployeeList',
              success: function (data) {

                  $($.parseJSON(data.d)).each(function (index, value) {
                  $("#TableID").append("<tr><td>" + value. + "</td><td>" + value.LastName + "</td><td>" + value.Email + "</td></tr>");
                  });
              },
              error: function (result) {
                  alert(result);
              }
          });

      });



here is my services function

C#
public List<Employe> GetEmployeeList()
       {
           var listEmployee = new TestEntities().Employes.ToList();
           return listEmployee;
       }
Posted
Comments
PIEBALDconsult 27-Dec-15 16:13pm    
Is the correct port on the server open?
awaisshabir 27-Dec-15 16:21pm    
yes port are open its show cross domain error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900