I have a situation where all client OnClick events have stopped working when the code is hosted under IIS, yet work perfectly when run in the VS2010 environment.
The page is a simple ASPX page with one textbox and one linkbutton on, the linkbutton OnClick calls an event handler btnMyButton_Click.
When run under IIS, the event handler is never called (I have stepped through the code to determine this) but the page is posted. When run under VS2010, the event handler is called as wanted.
The IIS environment is Windows 7, IIS 7.5, ASP.Net 4.0 with an integrated AppPool.
This has also been verified on a Windows Server 2008 R2 server, again with IIS 7.5, ASP.Net 4.0 and an integrated AppPool.
I have tried turning off Event Validation for the page, no dice.
Does any one have any ideas?
Edited to add: Ok, some significant new info. The issue is down to how you visit the page:
http://mydomain.com/SomeFolder/ <- when visited using this url, the OnClick events do not fire
http://mydomain.com/SomeFolder/Default.aspx <- when visiting using this url, everything works as normal
And the answer to this one is simple, but quite buried 🙂
I had “runAllManagedModulesForAllRequests” set to true in the system.Webserver modules block in the web.config.
Even tho I had no modules defined (just http handlers), it was still causing issues – set it to false and normal service resumed.