how to calling asp.net function from javascript for the non-static method?

evilrenan

New Member
i am calling asp.net function from javascript using this code as given below : but i need to call non-static method. when i remove the static field function not firing. There is any way to do this ? thank you\[code\]public partial class Test : System.Web.UI.Page{ [WebMethod] public static string HelloWorld(string name) { return string.Format("Hi {0}",name); }}<script type="text/javascript">function GreetingsFromServer() { var name = 'Jalpesh'; PageMethods.HelloWorld(name,OnSuccess, OnError); return false;}function OnSuccess(response) { alert(response);}function OnError(error) { alert(error);}\[/code\]
 
Back
Top