I am trying to run a script when a button is pressed on my Login.aspx page in Visual Studio 2008. I have set the Sub routine which is located within the script to redirect me to a certain page when the script is run for testing purposes. When I press the button the script is not executed and I am redirected to my default.aspx page instead of the one specified. Can someone help me I am new to asp.net and maybe doing something wrongs.
Thanks
<body>
<!-- Start of Script-->
<script language="VB" runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Redirect("AdminPage.aspx")
Session("LoggedIn") = Nothing
FormsAuthentication.SignOut()
Label2.Visible = False
End Sub
</script>
<!-- End of Script-->
<!-- start header -->
<div id="header">
<div id="menu">
<ul>
<li class="current_page_item"><a href="default.aspx">Homepage</a> </li>
<li><a href="blogs.htm">Blogs</a></li>
<li><a href="photos.htm">Photos</a></li>
<li><a href="about.htm">About</a></li>
</ul>
</div>
<!-- ASP BUTTON-->
<h5 align="right" style="width: 908px" ><a href="Default.aspx"><u><asp:Button ID="Label2"
onclick="Button1_Click" runat="server" Text="LogOut"></asp:Button></u></a></h5>
</div>
IF YOU NEED TO SEE MORE CODE LET ME KNOW.