1

My department is currently converting all of our projects from 2.0 to 3.5, and we are experiencing an odd side effect. It seems that most, if not all, control events aren't firing after we convert the projects to the 3.5 framework. At least not initially. Case in point, I was looking at one of our internal interfaces that had been converted, and none of the button click events of drop-down selected index changed events were firing. I moved on to something else unrelated then went back to the page approximately 2 hours later, and then the events were firing.

I've loaded the .aspx page in Design mode and ensured that the events were tied properly to the code-behind methods, and some projects still don't respond to events.

Has anyone experienced this? I've done some searching on the web and have not been able to find any relevant answers. Any information would be greatly appreciated!

James

James McConnell
  • 2,180
  • 3
  • 19
  • 29

6 Answers6

1

I see a similar problem except that it ALWAYS works in FF, Chrome and Safari, and NEVER in IE8 or 7.

When I manually write the even handlers in, it works. Same exact behavior on both the development and production servers.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
0

Have you tried the solution posted here? Apparently a similar problem occurred when people installed .NET Framework v1 SP1. You may be able to tailor this solution to .NET 3.5 as well.

You may also want to try this response to a similar question here on stackoverflow.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
0

I've suffered from an "events not firing" problem, and found a problem/solution that might help some users. I run my dev web sites on Chrome (being my default browser), but was finding that from time-to-time certain UIs would work for a while, and then suddenly all events would stop firing. This was very frustrating to debug, until I got the bright idea of trying to test the UI in IE. I started to use the UI in IE, and then (as expected), all events stopped firing (in the same way as happened in Chrome). But (unlike Chrome) sitting at the bottom-left corner of the IE browser was a warning icon with a message like "done, but with errors on the page". That was the problem all along: an error had occurred that did not render in the main part of the browser (i.e. the UI still looked like it was functional). In Chrome, the lack of a visual warning that there was a problem made it look like everything was okay. My error was something to do with a security issue (Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument), but there could be many errors that cause the UI to disconnect from the event model. I don't know how to turn on the warning mechanism in Chrome, but if you are having "events not firing" problems, run the UI in IE and stare intently at the bottom-left corner of the browser.

Andrew Jens
  • 1,032
  • 15
  • 16
0

I've run into the same issue when converting a site from .net 1.1 to 3.5. As in the opening post on some pages the buttons work fine whilst on others they do not. There doesn't appear to be any common ground between the pages that don't work.

I've tried changing the code so that it matches the pages that do work so changing the use statements, changing the autowireevent property to be specified and set to true, removing the system key word where it isn't necessary. I've also tried specifically adding the events in the pageload as with:

this.dlCVs.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler
    (this.dlCVs_ItemDataBound);
this.dlCVs.ItemCommand += new System.Web.UI.WebControls.DataListCommandEventHandler 
    (this.dlCVs_ItemCommand);
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
this.btnHome.Click += new System.EventHandler(this.btnHome_Click);

Interestingly though in the above the itemdatabound event does actually work so its only the button clicks that fail to work.

So far the only solution that I've come across is to delete the page and then recreate it and copying in the individual sections of the code. If I copy the code in one big block then this solution doesn't work.

Christian Specht
  • 35,843
  • 15
  • 128
  • 182
Matthew
  • 11
0

I haven't experienced something like that, but the closest I can think of are:

  • AutoWireEvents - for Page_Load, etc. If the methods are not configured explicitly in generated code, this should be set to on.
  • If you are configuring events on the aspx like OnClick="something_OnClick", make sure the methods in the code behind are protected (instead of private). That said, it is weird, as my experience with it is that it fails to compile if it is set wrong.
eglasius
  • 35,831
  • 5
  • 65
  • 110
0

I am having this same issue -- I'd say I have about a 33% chance of a page's buttons not being wired up. In other words, 2 out of every 3 times I navigate to the page it seems to work, but that third time NONE of the buttons on the page work.

I seem to have it narrowed down to pages with a ScriptManager on them, but I have no idea why that matters.

nathaniel
  • 1,135
  • 2
  • 8
  • 20