Reputation: 27833
I am working on a DotNetNuke module that consists of several different screens, with each having it's own set of user interface interactions. I decided to handle this by putting each screen in a different module control. The only way I can find to load that control is to give the link a URL via:
Globals.NavigateURL(Constants.LicenseDetailControl, "clientId=" + _clientId, "licenseId=" + data.Id, "mid=" + this.ModuleId);
Unfortunately, this restricts the page to ONLY render this specific module, due to the mid=xxx
query parameter. However if I do not provide the module ID parameter then my control doesn't render at all and the page is blank.
Is there any way to render a specific control without forcing the page to only display one module?
Upvotes: 1
Views: 1068
Reputation: 1247
Is there any way to render a specific control without forcing the page to only display one module?
No is the answer.
Rending a specific control by specifying the ctl type and the module Id is usually used for editing and admin modules, and they specifically exclude the other modules from the page.
As Mitchel has answered, you have to do the dynamic loading yourself. There are other modules that do this, you could copy the patterns. A lot of the Ventrian modules use their own Url specifications to load the different controls (which means not using the /ctl/xx and /mid/yy in the Url, but replacing it with your own definition, like 'view=x')
However, you can also look at spreading your module across different pages, so that one DNN page has a 'list' and another has the 'view'. This gives a more logical set of Urls (imagine a License list page called /licences and then a licence detail page called /licence/licenceId/xx). It also allows for more flexibility in using the module throughout the site. But it does make the install less intuitive because it just dumps all the modules on the one page.
I wrote a blog post on this topic a while back - trying to explain how it all fits together. It's older but all still relevant and might give you some more information. Designing, Structuring and Architecting DotNetNuke Modules
Or, as another commenter has already posted, just do full AJAX display of the content.
Upvotes: 3
Reputation: 63136
Well, the answer to this isn't quite as easy as you might hope. The situation that you are looking at is what is known as "module isolation" and from a framework perspective there is no real way to get around it.
However you have a few options on how you can do this within your module to get the desired effect.
Personally I go with either 1 or 3. One works well and is the most clean, but I've found that some controls have issues with dynamic injection. Option 3 is preferred by me otherwise in that I can disable viewstate on all controls that are not being rendered to reduce page size that would otherwise be bloated by 2.
Upvotes: 2