, , . , . , , , , :
1) , , , ajax jQuery , - , . , , :
$.ajax({
dataType: "json",
contentType: "application/json; charset=utf-8",
type: 'POST',
data: [],
url: '<%= ResolveUrl("~/Test.asmx/HelloWorld") %>',
success: function (data) {
alert(data);
},
error: function (xhr, err) {
$('#ajaxResponse').html(xhr.responseText);
}
});
2) jQuery ajax, -. , - script :
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Test
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "[{""Hello World""}]"
End Function
End Class
, , . , , ...