如何将数据或事件信息从Javascript发送到Default.cs(Asp.net)?

时间:2021-05-26 01:40:02

How can I send data or event info from Javascript to Default.cs (ASP.NET)? is it ajax?

如何将数据或事件信息从Javascript发送到Default.cs(ASP.NET)?它是ajax吗?

1 个解决方案

#1


You will need to create an AJAX call to Default.aspx.

您需要创建一个对Default.aspx的AJAX调用。

Using jQuery:

$.ajax({
    type: "POST",
    url: "Default.aspx",
    data: "first=John&last=Doe",
    success: function(msg){
        alert( "Data saved: " + msg );
    }
});

#1


You will need to create an AJAX call to Default.aspx.

您需要创建一个对Default.aspx的AJAX调用。

Using jQuery:

$.ajax({
    type: "POST",
    url: "Default.aspx",
    data: "first=John&last=Doe",
    success: function(msg){
        alert( "Data saved: " + msg );
    }
});