title: Redirect from button Click ASPX VB.NET
body: <p>I'm new in ASPX and VB.net so i'm trying to implement simple onClick method from my aspx page to open a new one but i'm getting the following error:</p>
  
  <p>Button is not a member of asp.net.</p>
  
  <p>Here is my simple html page with bootstrap:</p>
  
  <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" CodeBehind="login.aspx.vb" Inherits="gabServizi.login" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
       &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
       &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/&gt;
      &lt;link rel="icon" href="/img/favicon.ico"&gt;
      &lt;title&gt;Gab Servizi: Login&lt;/title&gt;
      &lt;link href="Content/bootstrap.min.css" rel="stylesheet" /&gt;
      &lt;link href="style/login.css" type="text/css" rel="stylesheet" /&gt;
  
  &lt;/head&gt;
  
    &lt;body class="text-center"&gt;
      &lt;form class="form-signin fade-in"&gt;
        &lt;img class="mb-2 " src="/img/gabservizi.png" alt="" width="160" height="160"&gt;
  
        &lt;h1 class="h3 mb-3 font-weight-normal" translate="yes"&gt;Accedi a Gab Servizi!&lt;/h1&gt;
        &lt;label for="inputEmail" class="sr-only"&gt;Email&lt;/label&gt; 
        &lt;input type="email" id="inputEmail" class="form-control" placeholder="Email..." required autofocus&gt;
  
        &lt;label for="inputPassword" class="sr-only"&gt;Password&lt;/label&gt;
        &lt;input type="password" id="inputPassword" class="form-control" placeholder="Password..." required&gt;
  
         &lt;div class="custom-control custom-checkbox mb-3"&gt;
  
             &lt;input type="checkbox" class="custom-control-input" id="ricordaCheck"&gt;
             &lt;label class="custom-control-label" for="ricordaCheck"&gt;Ricordami&lt;/label&gt;
  
         &lt;/div&gt;
  
          &lt;asp:Button class="btn btn-lg btn-primary btn-block" ID="Button1" runat="server" Text="Accedi" onClick="Button1_Click" /&gt;
  
        &lt;p class="text-muted mt-2 mb-3"&gt;Non hai un account? &lt;a href="register.aspx" class="text-primary"&gt; Registrati!&lt;/a&gt;&lt;/p&gt;
  
        &lt;p class="mt-4 mb-3 text-muted"&gt;GAB Tamagnini © 2014 Via Beniamino Disraeli, 17, 42124 Reggio Emilia&lt;/p&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is the vb part:</p>
  
  <pre><code>Public Class login
      Inherits System.Web.UI.Page
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
      End Sub
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          Response.Redirect("index.aspx")
      End Sub
  End Class
  </code></pre>