基本信息
源码名称:wcf restful简单实现代码(入门级)
源码大小:0.02M
文件格式:.zip
开发语言:C#
更新时间:2018-06-28
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 5 元 
   源码介绍
看例子

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input type="button" value="Test" id="btnTest" />
    </div>
    </form>
    <script type="text/javascript">
        $("#btnTest").click(function () {
            //$.get("http://localhost/wfcrestful/user/get/1", function (json) { alert(json) });
            /*
            $.ajax({
            "url": "http://localhost/wfcrestful/user/add",
            "type": "POST",
            "contentType": "application/json",
            "dataType": "json",
            "data": '{\"Id\":1,\"Name\":\"我是内容哦哈哈\"}',
            "success": function (returnValue) {
            alert(returnValue);
                   
            }
            });*/
            $.get("http://localhost/wfcrestful/user/GetList/22", function (json) {
                alert(json[0].Name);
            })

            return;
            $.ajax({
                "url": "http://localhost/wfcrestful/user/addlist",
                "type": "POST",
                "contentType": "application/json",
                "dataType": "json",
                "data": '[{\"Id\":1,\"Name\":\"我是内容哦哈哈\"},{\"Id\":2,\"Name\":\"我是eric\"}]',
                "success": function (returnValue) {
                    alert(returnValue);

                }
            });


        });
        
    </script>
</body>
</html>