Search code examples
dotnetnukeloadingascx

dotnetnuke module creation using .ASCX file


I was trying to understand how DotNetNuke dynamically loads web user controls (.ascx) that have statically defined event handlers. I've tried to go through the documentations available on DotNetNuke's website, but couldn't find a proper answer to my question.

Assume that the user control has a button inside it and has its click event specified in the .ascx file. The user control does not wire up the event handlers inside the page_load() or init(). So if the user control is dynamically loaded without wiring up the event handlers in the page_load() on every load, why does the event handler of the button still work? What is the process that DotNetNuke uses to create a module out of the ASCX file? It would also be great if anyone can point me to some documentation.


Solution

  • It simply loads the control early in the page lifecycle, there is nothing all that magical on how this works. They are regular ascx controls. The key is the definition of "AutoEventWireup" on the ascx.