BackgroundA DotNetNuke module is a collection of User Controls (.ascx files). These are grouped together by a module definition.
Default controls for a module are:
To navigate to different user controls you use the navigateurl method(s) which correctly build a path and also run the path through the friendly url provider to ensure it follows the applied format. It's most basic format allows the current tab(page) and module to access related controls are looks like this:
Navigate to View control You can navigate to the View control by:
Response.Redirect(Globals.NavigateURL(), true)
This code essentially adds a controlkey of "view" to load the relevant view control
Navigate to shared controlThere are a lot of shared controls such as login, register and access denied that can be called. In each case you supply the tabid with the call so the logic can determine which portal the shared control is using e.g.
NavigateURL(portalSettings.ActiveTab.TabID, "Login")
In some cases this tabid is optional e.g. for access denied either of the following two calls is fine
Response.Redirect(Globals.NavigateURL("Access Denied"), true);
or
NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied");
Passing additional parametersThe NavigateURL methods also support passing additional parameters via parameter collections e.g.
NavigateURL(_portalSettings.ActiveTab.TabID, "Register", extraParams);
or
NavigateURL(_portalSettings.ActiveTab.TabID, "", "UserID=" + userID + "&Param2=" + paramValue + "¶m3=" + param3Value);
or
NavigateURL(_portalSettings.ActiveTab.TabID, "Profile", "UserID=" + userID);
Navigate to Edit control You can navigate to the Edit control by:
Response.Redirect(EditUrl())
Note: edit controls load in an admin skin (i.e. have 1 central contentpane)
Navigate from Edit controlAs noted, you can load the view control via a simple request:
DotNetNuke.Common.Globals.NavigateURL()
However if you want to also pass some information back from the edit control you will need to provide that to the method.
The navigateurl overloads also enable the ability to specify a moduleid as well -in the following example a path is generated based on the tabid and mid (moduleid) - in this case rather than use a controlkey at the start the path adds "ctl" and "details" (which is the view control) which adds the necessary fields
DotNetNuke.Common.Globals.NavigateURL(TabId, "","mid", ((int)DataBinder.Eval(Container.DataItem,"ModuleID")).ToString(),"CourseID", ((int)DataBinder.Eval(Container.DataItem,"CourseID")).ToString(),"ctl", "Details", "")
Additional reference