Understanding Module Isolation in DotNetNuke

Also known as "Why Did My Skin Just Change?" and "Why Doesn't NavigateURL work?"

When navigating to between controls within your [DotNetNuke] module, you have many options (and would do well to read Michael Washington's Module Navigation tutorial on the subject).

If you decide to use the built-in navigation mechanisms, when you want to navigate to your control with the key "EditItems", you'd get the URL by calling EditUrl("EditItems") (or one of its overloads, depending on what other information you need on the querystring).  This method returns a new URL with three pieces of information on it: the current page (tabId), the current module (mid), and the control key your provided (ctl).

Here's where we encounter module isolation.  When "mid" is on the querystring,  [DNN] loads only that module on the page.  If you try to avoid this by using the NavigateURL method instead of EditUrl, [DNN] won't know which module to load the control for, so it won't load anything.

In addition to not showing the other modules that are usually on that page, one of the biggest side effects of module isolation that you'll notice is that your skin and container change.  When in module isolation, the admin skin and container are used (though, starting in [DNN] 5.0, there is no longer an admin skin, so this shouldn't be an issue going forward starting in [DNN] 5.0, these are called the edit skin and container, rather than "admin").  If you have a different admin skin, this can be quite jarring to you and your users.

If the consequences and side effects of module isolation work for you/your customers/your users, then it is definitely the easiest method of getting around your module's controls.  However, it has its drawbacks.  If you need more control, again, check out Michael Washington's Module Navigation tutorial.

No Comments