Further investigation with the page referenced in the question as well as other similar pages revealed that the problem had nothing to do with changing between the StyleSheetTheme
and Theme
attributes of the @ Page
directive. I changed the question/title to reflect this.
The actual reason the pageLoad()
function was not being triggered in the particular Javascript file I was working on is that there was already another pageLoad()
function defined in a separate Javascript file being used by the page, and it was the one being executed because it was included later and over-rode/replaced the one I was working on. I found this using a script debugger by locating the pageLoad handling within the ScriptResource.axd file (in function Sys$_Application$raiseLoad()) and following execution into the second, over-riding script file... Palm, meet forehead...
Takeaway points:
- only one
pageLoad()
can operate at the page level without resorting to some kind of scheme to daisy-chain multiple scripts; I opted for this approach so each of my script files can add its own (re-)initialization to the chain without clobbering any that are already there - using the
StyleSheetTheme
attribute vs theTheme
attribute had nothing to do with my problem - try to be (even more) careful to ensure clear and clean tests before posting to SO... I thought that I had done a simple A/B test of the page directive attributes and that it had solved the problem, but upon discovering the true cause I went back to review the screen-captures (I use for time-tracking) and discovered that I had made two changes, not just one, before observing the change in behavior. It was the other change (removing another Javascript file from my page) that had fixed it, but during an interruption between the changes and final testing I forgot that I'd done it