c# - Ajax/Json post to aspx page results in 404 error -


i'm trying ajax post c#. when post though, results in 404 error. here's code: javascript:

var submitparams = {                             'companyname': $("#company_name").val(),                             'companyaddress1': $("#company_address_1").val()                         };                          $.ajax({                             type: "post",                             url: "clientmanagement.aspx/submit",                             datatype: "json",                             contenttype: "application/json; charset=utf-8",                             async: true,                             data: json.stringify({ submitparams }),                             success: function () {                                 alert("hi");                                 $(this).dialog("close");                             },                             error: function (e) {                                 debugger;                             }                         });  c# code:     [webmethod]     public static void submit(object parameters)     {         string name = parameters.tostring();     } 

so can't find clientmanagement.aspx/submit method. jumps straight "error" function. also, being performed on regular aspx page.

any idea i'm doing wrong?

could simple as

url: "/clientmanagement.aspx/submit" 

?


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -