I have created a form in ASP.NET using C#. Now I want to implement AJAX on it.
Click Here to see the form.
I have used a GridView to show the saved information. I have absolutely no idea what to do and from where to start. If someone could guide me how to do it...?
write "onClick" function like:
onClick="myClick()";
define this click in your js file like:
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();
}