Change the declaration to:
Code:
<a class="button" href="#" onclick="check" runat="server">
And modify your method signature to:
Code:
Public Sub check(sender As Object, e As EventArgs)
Out of interest, the code is subject to SQL injection attacks . May want to look at session hijacking as well