Help, My events are not firing – ASP.NET

My dear friend co-worker authorized my blog to post his valuable finding of today. His own blog link shall not be mentioned as it is ‘work in progress’ and still too ugly and has no dog photos 😉 I will  definitely link it when it is ready, promising good stuff around custom dev and our favorite SharePoint dev.


You have a website http://site with default document http://site/default.aspx

In default.aspx, you have a button with event handler:

<asp:Button ID=”btnAddNote” Text=”Add Note” runat=”server” OnClick=”OnButtonClick” />

protected void OnButtonClick(object sender, EventArgs args){// some interesting code}

1)      You go to http://site/default.aspx and click button. It works fine!

2)      You go to http://site and click button. Page posts back but NOTHING HAPPENS. No event is fired. You debug, put breakpoint there, but it is never hit.


  • You are running IIS 7.0 or 7.5
  • You are running .NET 4.0
  • You have some httpmodules added in your web.config

Then you may be a victim of a breaking ASP.NET 4.0 change:

Quick solution:

In your code behind, on Page_Load, put:

this.Form.Action = “Default.aspx”;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s