Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Ajax jQuery ASHX
Hello All, i want to pass a parameter from .js file to ASHX Handler using jQuery.ajax
this is my js function
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
[WebMethod]
    public static string PathMethod(string name){
        return name;
    }
 
after I passed parameter to PathMethod, the result of
alert(msg.d);
is 'undefined'.
 
how can I solve this problem?????
Posted 13-Feb-13 22:15pm
Comments
ryanb31 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 518
1 OriginalGriff 459
2 ChintanShukla 305
3 Richard Deeming 275
4 RyanDev 230
0 Sergey Alexandrovich Kryukov 8,858
1 OriginalGriff 7,451
2 CPallini 2,603
3 Richard MacCutchan 2,095
4 Abhinav S 1,893


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100