Retrieve webmethod from webservice

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Retrieve webmethod from webservice

Sara-77

hi every body

I want to call a webmethod of my webservice and to do this I try the 3
follwing methods but none of them show me the result and nothing
happen
It also has no error
please help me

Method 1:

jQuery.getJSON("WebService.asmx/HelloWorld" , function(json){
     jQuery("#result").html(json);
        });
Method 2:

jQuery.ajax({
    type: "POST",
    url: "WebService.asmx/HelloWorld",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(msg) {
      jQuery("#result").html(msg);
    }
  });

Method 3:

jQuery.ajaxDotNet("WebService.asmx/HelloWorld" , {
                verb: "GET",
                success: function(obj) {
                        jQuery("#result").html(obj);
                }
        });


Webmethod Code:

 <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Plugins" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/jquery-plugins?hl=en
-~----------~----~----~----~------~----~------~--~---