Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Code snippet ? to generate URLs for DNN pagesCode snippet ? to generate URLs for DNN pages
Previous
 
Next
New Post
6/10/2008 3:27 PM
 

I'm assuming that there is a recommended/preferred way of doing this so I thought I would ask. I'm looking for code snippets for each of the following cases:

1) Generate the URL for each of the pages set under Advanced Setttings Page Management, ie, for the "Splash Page", "Home Page", "Login Page", and "User Page" in a dynamic way that reflects the currently selected tabs as configured by the Site Admin.

2) Generate the URL for an arbitrarily named page from the list of named pages created for the Portal Site. So it should return the correct full URL for the page named "ThePage" where "ThePage" is one of the named pages configured in the list of pages for the site.

Thanks for the code snippets, or else the link to a discussion of this question. By the way, I looked in Professional DotNetNuke 4 but could not find anything in the book.


CT
 
New Post
6/10/2008 4:23 PM
 

Number 1 looks like DotNetNuke.Common.Globals.NavigateURL(PortalController.GetCurrentPortalSettings().SplashTabId).

Number 2 looks like the following:

            Dim tabs As New TabController()
            DotNetNuke.Common.Globals.NavigateURL(tabs.GetTabByName(tabName, PortalId).TabID)

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
6/10/2008 5:25 PM
Accepted Answer 

Thanks much for the code snippets.

Case number 1 works fine for me without any change.

Case number 2 also works fine for me but with a minor change as follows:

I replaced PortalId with PortalController.GetCurrentPortalSettings.PortalId so that it's properly set to the current active portal.

That code line now reads:

DotNetNuke.Common.Globals.NavigateURL(tabs.GetTabByName("TheDesiredTabName", PortalController.GetCurrentPortalSettings.PortalID).TabID)

Thanks again. I appreciate the pointer.


CT
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Code snippet ? to generate URLs for DNN pagesCode snippet ? to generate URLs for DNN pages


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out