Greetings once again!
I was surprised to see that when my module navigates the browser using EditUrl() to get the path to the module's edit view, the resulting page not only loads the edit view control for the module, but it also triggers the page_load events of all the other modules that belong to that page.
For example, using EditUrl(), the browser navigates to /Default.aspx?TabId=55&ctl=Edit&mid=397
First, the Page_Load method for the edit control of the module with id 397 executes, as expected. But then the Page_Load method for all the other modules that belong to tab 55 also execute! This I did not expect.
So my questions are:
1. Is this the expected behavior when you have ctl=Edit&mid=XXX passed to Default.aspx?
2. If so, what purpose does it serve loading up all the modules that are not visible when you have one module's edit control loaded?
3. Also, if this is the expected behavior, then is there an easy way to detect that the page is loading the edit mode of another module, and not your module, so that you can prevent a module from running all of its code when it's not going to be shown?