I have attached my sample Code.my code is not working and came this error-Microsoft JScript runtime error: 'PageMethods' is undefined.Give me any one Solution.
<script type="text/javascript" language="javascript">
function HandleIT() {
var name = document.getElementById('<%=txt.ClientID %>').value;
PageMethods.CodeBehind(name);
}
</script>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (IsPostBack <> True) Then
btn1.Attributes.Add("onclick", "javascript:HandleIT()")
End If
End Sub
Public Shared Function CodeBehind(ByVal val As String)
val = "this is a string from C# code behind " + DateTime.Now.ToString()
End Function