[Play.aspx] <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> ..... viewvideo(videoid) ....... </asp> [Video.js] function viewvideo(videoid) { varVideoid = videoid; $("#video").empty(); var data = Ajax("../Ajax/Webmethod.aspx/getviewvideo", { videoid: videoid }); } [function.js] function Ajax(url, _data) { var obj; $.ajax({ type: "post", url: url, data: JSON.stringify(_data), async: false, contentType: "application/json; charset=utf-8", datatype: "json", success: function (data) { obj = $.parseJSON(data.d); }, error: function (xhr, status, error) { alert("Some Error"); } }); return obj; } [Webmethod.aspx.cs] [WebMethod] public static string getviewvideo(string videoid) { databasesss db = new databasesss(); JavaScriptSerializer js = new JavaScriptSerializer(); ......................... } return js.Serialize(v); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)