all groups > dotnet general > february 2008 >
You're in the

dotnet general

group:

Buttons on a web page


Buttons on a web page Morton
2/13/2008 8:37:01 AM
dotnet general:
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

RE: Buttons on a web page Zeeshan Haider
2/13/2008 4:24:25 PM
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.

[quoted text, click to view]
AddThis Social Bookmark Button