jquery - POST HTTP://localhost:53122/albumlist.aspx/www 404 (Not Found) -
i using vb.net .i need call function written in albumlist.aspx using jquery below:
var l = window.location; var base_url = l.protocol + "//" + l.host; $(".pagen ").click(function() { var num = $(this).attr('id'); $.ajax({ type: "post", url: base_url + '/albumlist.aspx/www', data: { id: num }, datatype: 'json', encode: true, async: false, cache: false, success: function(response) { console.log(response); }, error: function(jqxhr, textstatus, errorthrown) {} }); });
function is:
public function wwww(byval id integer) string return "jhgfjhf" end function
using code, getting 'post http://localhost:53122/albumlist.aspx/www 404 (not found)'. should do, new vb.
there other problems, can spot @ least two. first, have mark method <webmethod>
attribute. second, methods inside of .aspx page must marked shared
in order visible web methods.
Comments
Post a Comment