ajax读取数据

前端JS:

function GetData(id) {
        var url = "ajax/Handler.ashx";

        $.ajax({
            type: "POST",
            url: url,
            dataType: "html",
            async: true,
            data: {
                "id": id
            },
            success: function (data) {
                $("#video_P").html(data);
            }
        });
    }

后端:

public void Get()
    {
        int id = Convert.ToInt32(HttpContext.Current.Request.Form["id"]);
        Video = BllFriendLink.GetModel(id);
        string html = Video.Url;
        HttpContext.Current.Response.Write(html.ToString());
    }

猜你喜欢

转载自www.cnblogs.com/zzx849918265/p/9436627.html