Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All, i want to pass a parameter from .js file to ASHX Handler using jQuery.ajax
this is my js function
JavaScript
function SendPath(input) {
    $.ajax({
        'type': 'POST',
        'url': './Upload.ashx/PathMethod',
        'data': {
            'name': 'Programmer',
        },
        'success': function (msg) {
            alert(msg.d);
        }
    });
}


and this is my ASHX WebMethod
HTML
[WebMethod]
    public static string PathMethod(string name){
        return name;
    }


after I passed parameter to PathMethod, the result of
JavaScript
alert(msg.d);
is 'undefined'.

how can I solve this problem?????
Posted
Comments
ZurdoDev 14-Feb-13 8:53am    
Is it hitting your method in c#?

1 solution

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