我已经使用C#在ASP.NET中创建了一个表单。现在我想在上面实现AJAX。
Click Here 查看表单。
我使用了一个GridView来显示保存的信息。我完全不知道该做什么,也不知道从哪里开始。如果有人能指导我怎么做...?
发布于 2017-07-18 14:01:33
像这样编写"onClick“函数:
onClick="myClick()";
在你的js文件中定义如下点击:
function myClick(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
//to get response on the html
}
};
xhttp.open("GET/post", "urltocall", true);
xhttp.send();
}https://stackoverflow.com/questions/45158555
复制相似问题