I believe you will have to use AJAX for this. Have a look here: https://www.aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx
ReloadData will be a webmethod in your code behind and will look something like this:
[System.Web.Services.WebMethod]
public void ReloadData()
{
//here is the code
}
Then from the client side you will do something like this:
function GetData() {
$.ajax({
type: "POST",
url: "CS.aspx/ReloadData",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function(response) {
alert(response.d);
}
});
}
CS.aspx
is the name of your webpage.
Following on from your comment below; if you did not want to use JQuery then your Javascript code would look something like this:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'CS.aspx/ReloadData');
xhr.onload = function() {
if (xhr.status === 200) {
alert('Successful');
}
else {
alert('Request failed. Returned status of ' + xhr.status);
}
};
xhr.send();