Link to home
Start Free TrialLog in
Avatar of narmi2
narmi2

asked on

OnClick Error Message

Dear Experts.

Does anyone know why I am getting an error with the code below when I click the <a> tag?  The error I get is:

A1_ServerClick is undefined
<%@ Page Language="VB" runat="server" debug="true" explicit="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		
		<script language="VB" runat="server">
			Sub A1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
				response.write(StripTest(sender.HRef))
			End Sub
			
			Private Function StripTest(ByVal getlink As String) As String
				Return Mid(getlink, (Len("http://intranet") + 1), (InStr(getlink, ".aspx", CompareMethod.Binary) - (Len("http://intranet") - 4)))
			End Function
		</script>
	</head>
	
	<body>
	    <form id="Form1" method="post" action="search.aspx">
			<a href="http://intranet/test/mydocument.aspx" runat="server" onclick="A1_ServerClick">mydocument</a>
		</form>
	</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of divyeshhdoshi
divyeshhdoshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial