Link to home
Start Free TrialLog in
Avatar of pvg1975
pvg1975Flag for Argentina

asked on

ASP.NET - Button not firing up code when pressed

Hi All,

I have something really weird going on here.

on a .aspx page I have the following code as a first line:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="cpanel3_cancel.aspx.vb" Inherits="cpanel3_cancel" %>

Then on that page, I have a button, as follows:

<asp:Button ID="Button2" runat="server" Text="Cancel Account" />

and on the file cpanel3_cancel.aspx.vb I have the following code:

    Protected Sub Button2_Click(sender As Object, e As System.EventArgs) Handles Button2.Click
            .....
            .....
    End Sub

But when I click on Button2, nothing happens!

Please help!
ASKER CERTIFIED SOLUTION
Avatar of jacekmalinowski
jacekmalinowski
Flag of Poland image

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
Avatar of pvg1975

ASKER

I actually fixed it by setting the runat="server" in the header... so you lead me the right way. Thanks!