Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "WebService.asmx/HelloWorld",
- data: "{}",
- dataType: "json",
- success: function(msg) {
- alert(msg.d);
- }
- });
- [System.Web.Script.Services.ScriptService]
- public class Service : System.Web.Services.WebService
- [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
- $(document).ready(function() {
- $('#clKaydet').click(function() {
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "WebService.asmx/HelloWorld",
- data: "{}",
- dataType: "json",
- success: function(msg) {
- alert(msg);
- }
- });
- });
- });
- <form id="form1" runat="server">
- <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />
- <div>
- <input type="button" id="clKaydet" runat="server" value="Kayıt" onclick="Kayit()" />
- </div>
- </div>
- </form>
- <WebMethod()> _
- Public Function HelloWorld() As String
- Dim sText As String = "Hello"
- Return sText
- End Function
Add Comment
Please, Sign In to add comment