简体   繁体   中英

call server side inherited C# web method from javascript

Please Help me, I want to call a server side function in page1 from page2 using java script.

For example in Home.aspx.cs i have read() webmethod and i want to call this method from Call.aspx 's Javascript function.

You need to create an ajax call:

$.ajax({
    url: "linkToOtherPage",
    method: "POST", // or GET, I don't know what you need
    data: dataToPass,
    success: function (response) { },
    error: function(jqXHR, textStatus, errorThrown) { }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM