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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0how to find the tab_id by knowing page name?how to find the tab_id by knowing page name?
Previous
 
Next
New Post
9/5/2008 11:59 AM
 

I am supporting an existing dnn app. I see code that uses something like this:

PortalSetting.SupportTabID

 

when I make a new tab from a custom user control and want to set links to this page... how can i determine the tab_id of the page within my local portal, the one in QA and the one in production?

 

i know that in different portals the control can be added to any number for its tab_id, so how do i determine this programmatically. i need this info to use in link generation to this particular tab.

 

thanks

 

 
New Post
9/5/2008 6:08 PM
 

Would be quite a welcome addition to DNN wouldn't it?

Well, here's some code I created that solves this but be mindful that this searches by the Name of the Page ... so if you have a root page called Test and put a page who has Test as it's parent and name Level 2, when you search for this subpage it's named ...Level 2 and not Level 2.  Just like Pages look in the Pages listbox.

Public Function GetTabID(ByVal PageName As String) As Integer

        ' Locals

        Dim objTab As DotNetNuke.Entities.Tabs.TabInfo
        Dim arrPortalTabs As ArrayList

        ' Get the Tabs

        arrPortalTabs = GetPortalTabs(PortalSettings.DesktopTabs, False, True, False, True)

        ' Find the TabID based on the Name

        For Each objTab In arrPortalTabs
            If objTab.TabName = PageName Then
                Return objTab.TabID
            End If
        Next

        ' Return

        Return 0

    End Function

 
New Post
9/5/2008 6:43 PM
 

Something like this? (C#)

DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController();
DotNetNuke.Entities.Tabs.TabInfo ti = tc.GetTabByName("TabName", portalId);

Then just access ti.TabId


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0how to find the tab_id by knowing page name?how to find the tab_id by knowing page name?


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