我的脚本代码:
$('#btnSave').click(function() { var pageUrl = '<%= ResolveUrl("~/TestPage.aspx/SystemEdit")%>'; var ip = $('#editIP').text(); var loc = $('#txtBay').val(); var team = $('#txtTeam').val(); var port = $('#txtPort').val(); var xcel = "",office = "",moni = ""; var parameter={ "ip": ip,"loc": loc,"team": team,"port": port,"excel": xcel,"office": office,"monitor": moni} $.ajax({ type: 'POST',url: pageUrl,data: JSON.stringify(parameter),contentType: 'json',success: function(data) { alert(data); },error: function(data,success,error) { alert("Error:" +error); } }); });
[WebMethod] public static string SystemEdit(string ip,string loc,string team,string port,string excel,string office,string monitor) { return "The Current Time is: "+ DateTime.Now.ToString(); }
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。