I have a function named \"callfunction()\" in JavaScript(Mypage.aspx) .This function should call another function \"func()\" in C# (Mypage.aspx.cs )
Something like
Ok....Try using page methods
First add a script manager on your aspx page
Then go to your aspx.cs page and declare a function something like
[System.Web.Services.WebMethod]
public static string ValidateUser(string emailId, string password)
{
//Your logic code
return returnString;
}
Then from your javascript call the c# method like
PageMethods.ValidateUser(email, password, CallSuccess_Login, CallFailed_Login);
And also in ur javascript create 2 call back functions CallSuccess_Login
and CallFailed_Login
Hope it helps