DotNetNuke – Modules – Linking within the module

OLYMPUS DIGITAL CAMERA         Now that we have the module skeleton up and running and we have a data access layer, the next thing we need to look at is specific functions you may need to use from within your code. One of the most useful functions is Globals.NavigateURL(). This is particularly useful if you want to generate a hyperlink back to the same page you are on. But with some additional code that we’ll introduce later, you can also use this to generate a hyperlink to another page.

Globals.NavigateURL() is located in the DotNetNuke.Common namespace. You’ll need to make sure that namespace is in whatever class you call this function from. Globals is the class name and NavigateURL is a static method with ten different overloads.

NavigateURL()
This simply provides a URL back to the page you are on. This is typically used from the Edit controls so that you can link back to the view that the edit control was originally on.

NavigateURL(int TabID)
This generates the URL to the page specified by TabId. In the early days of DNN, a page was a Tab on the navigation. TabId has kind of stuck ever since.

NavigateURL(string ControlKey)
If you need to generate a URL back to a specific control in the module (Edit or some other custom key), you can use this to generate that URL.

NavigateURL(int TabID, bool IsSuperTab)
The IsSuperTab parameter adds the PortalID to the URL if it is set to true.

NavigateURL(int TabID, string ControlKey)
This should be obvious. It creates a URL that leads to the page represented by TabID and the control represented by ConrolKey.

NavigateURL(string ControlKey, params string[] AdditionalParameters)
Next to NavigateURL(int TabID), this is probably the most useful form of this method. If you need to pass parameters into the page you are calling, this is the method you need. Using this function, you can do something like this:

string[] items = {"itemid=24"};
Globals.NavigateURL("",items);

Which will call back to the page you are on with itemid=24 as the parameter/value.

You can also use:

NavigateURL(int TabID, string ControlKey, params string[] AdditionalParameters)
if you need to call another page with parameters.

The three other overloads are similar to what I’ve already shown. The only additional parameter you need to be aware of is PortalSettings which, as far as I know, is only used internally. Don’t worry about it.

 


Other post in DotNetNuke - Module Development

Other Related Items:

Laura Geller Balance-n-Brighten Compact .32 oz (9 g)Laura Geller Balance-n-Brighten Compact .32 oz (9 g)A color correcting baked liquid
This extraordinary formula is the result of an exclusive, labor intensive process developed and produced in Italy. ... Read More >
Transcend IDE Flash Module Vertical - Solid state drive - 512 MB - internal - IDETranscend IDE Flash Module Vertical - Solid state drive - 512 MB - internal - IDETranscend's IDE Flash Modules are specially designed for use in the demanding industrial environments where industrial PCs, Set-Top Boxes and other computer systems must operate. IDE Flash Modules are a convenient and easy to use solution for expanding an industrial computer's memory capacity.
Novatel Merlin XU870 3G HSDPA - Wireless cellular modem - plug-in module - ExpressCard/34 - GSM, GPRS, UMTS, EDGE, HSDPA - 7.2 MbpsNovatel Merlin XU870 3G HSDPA - Wireless cellular modem - plug-in module - ExpressCard/34 - GSM, GPRS, UMTS, EDGE, HSDPA - 7.2 MbpsThe Merlin XU870 ExpressCard is a smaller and faster version of a PCMCIA card that uses the ExpressCard/34 form factor. This global card, tri-band HSD... Read More >

Related Post

Comments are closed.

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor