前台代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="jquery-3.2-vsdoc2.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" >
        jQuery(function () {
            jQuery.ajax({
                type: "Post",
                url: "/WebService1.asmx/HelloWorld",
                data:"{name:'likong'}",
                dataType: "json",
                contentType:"application/json;charset=utf-8",
                success: function (result) {
                    window.alert(result.d);
                },
                error:function(err){
                    window.alert(err.status);
                    
                }

            })

        })
    </script>
</head>
</html>
View Code

相关文章:

  • 2021-12-05
  • 2021-11-04
  • 2021-12-15
  • 2021-05-15
  • 2021-09-29
  • 2021-08-02
  • 2021-09-06
  • 2022-01-06
猜你喜欢
  • 2021-09-01
  • 2022-02-15
  • 2021-12-28
  • 2021-10-05
  • 2021-06-08
  • 2022-03-09
相关资源
相似解决方案