Buttons on a web page

  • Thread starter Thread starter Morton
  • Start date Start date
M

Morton

I created a new web page and added a "Cancel" button.

The cancel button is supposed to activate a clicked event.

When I run the page in debug mode using IE 6 with a breakpoint set at the
button_click subroutine and then click the button - nothing happens

Any suggestions as to what I am missing?

Regards

Morton
 
1 - Make sure that button has runat=server attribute set.
2 - Attach the your handler/subroutine/menthod to button e.g. In C# you can
do it as, this.button.Click += new EventHandler(button_Click);
Probably the best place to add this line of code is InitializeComponent()
method. You can define such interaction between control and its subroutine
anywhere but you have to make sure that it must not be happened on postback
event.

Also make sure that your are not running your project in release mode if you
are using the Microsoft Visual Studio.
 
Back
Top