Re: How to add new an .ascx module to mojoportal
I think it would be clearer to you if you were working with the mojoportal source code instead of just against the compiled version. Then you could look at how other modules are implemented.
Pages that are in the menu can contain any modules but modules should never link to these pages for the reason you have found, they have no knowledge of the menu or page ids.
But modules can have related .aspx pages that they link to. These pages should inherit from mojoBasePage to support skinning but these pages do not appear in the menu and are only available by links from within the module because the module does know about these pages.
For example Blog Module, the module is BlogModule.ascx but it links also to BlogEdit.aspx and BlogView.aspx but neither of these pages are available in the menu they can only be accessed by links from the BlogModule.ascx. BlogModule passes in parameters to these pages and knows about these pages but it does not know about pages in the menu. In fact the blog module can exist in more than one menu page because you can have as many blogs in a site as you want but each has a different module id and item ids for the posts.
Why not just work with the mojoPortal source code where you can see the examples. There are even examples of external module in the source code which shows how you can have a post build action in the external project to copy the output (dll, .ascx, .aspx) from your external module to the correct locations in mojoportal web
Hope it helps,