DotNetNuke - Modules - Linking within the module
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
- Creating DotNetNuke Modules - May 20th, 2008
- Creating DNN Modules - The Tools - May 22nd, 2008
- DotNetNuke Modules - Foundational Concepts - May 26th, 2008
- DotNetNuke Modules - Install DNN into VS 2008 - May 27th, 2008
- DotNetNuke Modules - Creating Base Modules - May 28th, 2008
- DotNetNuke Modules - Registering Your Module - May 29th, 2008
- DotNetNuke Modules - Where Stuff Shows Up - June 3rd, 2008
- DotNetNuke Modules - Benefits of Architecture - June 4th, 2008
- DotNetNuke Modules - Anatomy of the View - June 9th, 2008
- DotNetNuke Modules - Adding Actions - June 11th, 2008
- DotNetNuke Modules - DNN Controls - Label - June 18th, 2008
- DotNetNuke - Internationalization - June 25th, 2008
- DotNetNuke Modules - Internationalization (part 2) - June 30th, 2008
- DotNetNuke Modules - Labels w/ no Help - July 9th, 2008
- DotNetNuke Modules - LinkButtons - July 14th, 2008
- DotNetNuke Modules - Collapsible Panels - July 16th, 2008
- DotNetNuke - The Data Layer - Installing CodeSmith - July 22nd, 2008
- DotNetNuke - Modules - Creating The Tables - July 24th, 2008
- DotNetNuke - Modules - Creating Stored Procs - July 29th, 2008
- DotNetNuke - Modules - Portal Specific Modules - July 31st, 2008
- DotNetNuke Modules - Data Access Layer - August 5th, 2008
- DotNetNuke Modules - Data Access Layer - August 7th, 2008
- DotNetNuke - Data Access Layer Alternative - August 12th, 2008
- DotNetNuke - Modules - Linking within the module - August 14th, 2008
- DotNetNuke - Make Your Module Searchable - August 19th, 2008
- DotNetNuke Modules - Making Content Portable - August 25th, 2008
- DotNetNuke Modules - Exceptions the DNN Way - September 2nd, 2008
- DotNetNuke Modules - PortalModuleBase - September 4th, 2008
- DotNetNuke Modules - Inter Module Communication - September 9th, 2008
- DotNetNuke Modules - Finding The Page a Module is On - September 15th, 2008
- DotNetNuke Modules - Caching - September 17th, 2008
- DotNetNuke Modules - Module Settings - September 22nd, 2008
- DotNetNuke Modules - Retrieving Settings - September 24th, 2008
- DotNetNuke Modules - Advanced Architecture - October 20th, 2008
- DotNetNuke Modules - Creating the PA - October 30th, 2008
- DotNetNuke Modules - Automating the PA - November 5th, 2008
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!



















































