add
[System.Web.Services.WebMethod()]
to your code like this
[System.Web.Services.WebMethod()]
public static void Method1()
{
class clss1 = new class()
class1.txtBox1_TextChanged(new object(), new EventArgs());
}
or use
jquery ajax
method
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "yourpage.aspx/yourmethod",
data: "{}",
dataType: "json",
success: function(data) {
},
error: function(result) {
alert("Error");
}
});
More info from
here and
here