-1
[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);
    }

Hi, I have speed issue when ajax calls webmethod, How can I improve the perfomance Any comment would be helpful Thank you

ps)I have tried to use but there are many things to edit so I am looking for another way

hapiten
  • 9
  • 3
  • Please read [ask]. Key phrases: "Search, and research" and "Explain ... any difficulties that have prevented you from solving it yourself". – Heretic Monkey Mar 27 '17 at 15:07
  • Thank you for your comment.I don't have many knowlage for ajax so I thought the code has something worng – hapiten Mar 27 '17 at 15:18

1 Answers1

0

Please refer following list one by one.

1. check SP code and check execution time and try to reduce Time(Check size of data)

2. call web method and check execution time.

3. Ajax just a call web method for get a data and set this data. so do not a more time.

Nayan Patel
  • 154
  • 7