How do I do an AJAX post to a url within a class library but not the same IIS Web Application?

Posted by Mark Adesina on Stack Overflow See other posts from Stack Overflow or by Mark Adesina
Published on 2012-06-16T09:04:54Z Indexed on 2012/06/16 9:16 UTC
Read the original article Hit count: 335

Filed under:
|
|

I have been working with ajax and there has been no problems below is how my ajax post code look like:

$.ajax({
  type: "POST",
  url: '<%=ResolveUrl("TodoService.asmx/CreateNewToDo")%>',
  data: jsonData,
  contentType: "application/json; charset=utf-8",
  datatype: "json",
  success: function () {
    //if (msg.d) {
      $('#ContentPlaceHolder1_useridHiddenField').val("");
      $('#ContentPlaceHolder1_titleTextBox').val("");
      $('#ContentPlaceHolder1_destTextBox').val("");

      $('#ContentPlaceHolder1_duedateTextBox').val("");
      alert('Your todo has been saved');
     // }
  },

  error: function (msg) {
    alert('There was an error processing your request');
  }

});

However, the problem came up when I try to get the url to a webservice that is located in a class library within the same solution.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about AJAX