I've been developing a custom module, and everything had been working according to plan. However, I had always been logged in as host. As soon as I logged out, my Submit button no longer worked. In fact, it appeared that none of my events would fire when I was logged out. Upon further testing, I found out that the same behavior took place if I was logged in as host, and in View mode. If I switch back to Edit mode, everything works.
Looking a little deeper, I found that DNN is appending extra identifiers to my control IDs in view mode. Investigating the page source, my submit button's ID in Edit mode looks like the following:
dnn$ctr425$ViewMyModule$myButton But in view mode, it looks like this:
dnn$ctr425$ViewMyModule$ViewMyModule$myButton
I went to View Mode, switched on Firebug in Firefox, and changed the ID to the "edit mode version". My submit button worked.
Why would DNN add extra terms to my control's ID in view mode? Am I looking at the source of the problem, or is it something else?