Button.Click Event won't fire on one of my pages

Joined
Jun 22, 2005
Messages
8
Reaction score
0
I've got a rather major problem.

Don't ask me why (if I knew I wouldn't be here) but one of my pages refuses to fire button events.

Now ... this is the really annoying bit .. it DOES fire other events (auto-postbacks from drop-down boxes, textboxes and also linkbutton click events).

Here is some of the code from my page (the one that WON'T postback with button events)

The button I am trying to fire is Button1

Code:
private void InitializeComponent() 
		{
			this.lkbPurchaseOrder.Click += new System.EventHandler(this.lkbPurchaseOrder_Click);
			this.lbtProvisionalPrintEnquiry.Click += new
System.EventHandler(this.lbtProvisionalPrintEnquiry_Click);
			this.Button1.Click += new System.EventHandler(this.Button1_Click);
                 }

		private void Button1_Click(object sender, System.EventArgs e)
		{
			Response.Write("Hello");
		}

The ASPX file contains the following for my button:

Code:
<asp:Button id=Button1 runat="server" Text="Abuse Me" Width="172px"></asp:Button>

I have set breakpoints on that event but it never triggers, I have checked the properties of that object and the Click event IS set correctly to the above subroutine.

No matter what I try and do, it won't call the Button1_Click routine when I click the button.

extreme frustration .. help??

One question though .. would CSS on the site be affecting this at all? (although another page on the site uses the same CSS settings, and the button events fire just fine!)
 
SOLVED !

http://support.microsoft.com/default.aspx?scid=kb;en-us;889877

http://aspalliance.com/699

Developers have found that a submit button suddenly stops working after installing ASP.NET 1.1 Service Pack 1. Unfortunately, Microsoft introduced a bug in SP 1 that causes this problem. They have documented it with a solution in Knowledge Base article 889877. However, that doesn't always work.

Paul Wilson and Thomas Freudenberg have posted their solutions on blogs. Here is their recommendation:

1. Open the WebUIValidation.js file in a text editor. The file is located in
[domain root]/aspnet_client/system_web/1_1_4322.
2. Locate the function ValidatorCommonOnSubmit.
3. Change it by adding return event.returnValue; as the last line:

function ValidatorCommonOnSubmit() {
event.returnValue = !Page_BlockSubmit;
Page_BlockSubmit = false;
return event.returnValue;
}

Careful! Javascript is case sensitive!

Thankyou thankyou thankyou ...

(fixed by the way .. and tested .. all working!)
 
Back
Top