Solved

ASP.NET - Button not firing up code when pressed

Posted on 2011-10-01
2
218 Views
Last Modified: 2012-05-12
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!
0
Comment
Question by:pvg1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
jacekmalinowski earned 500 total points
ID: 36897045
Hi,

You have to add OnClick to Button:
OnClick= "Button2_Click"
<asp:Button ID="Button2" runat="server" Text="Cancel Account" OnClick= "Button2_Click" />

Open in new window

0
 

Author Comment

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

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question