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.0append a urlparameter to all tabs in the menu from the moduleappend a urlparameter to all tabs in the menu from the module
Previous
 
Next
New Post
10/1/2009 11:44 PM
 

will this call the db or will it get it from earlier calls? i.e. how many calls do you think this will generate? 0?1? or n?

ArrayList tabs = new ArrayList();

//Build list of tabs to be shown to user
 

for (int i = 0; i<PortalSettings.DesktopTabs.Count;i++)
{
   DotnetNuke.Entities.Tabs.TabInfo tab = (DotnetNuke.Entities.Tabs.TabInfo)PortalSettings.DesktopTabsIdea [I];
   
if (tab.IsVisible && !tab.IsDeleted)
   {
      
if ((tab.StartDate < DateTime.Now && tab.EndDate > DateTime.Now) || AdminMode)  //bool SkinObjectBase.AdminMode
      {
         
if (DotnetNuke.Security.PortalSecurity.IsInRoles(tab.AuthorizedRoles))
         {
            tabs.Add(tab);
         }
      }
   }
}


 
New Post
10/4/2009 10:07 PM
 

ramzih wrote
 

I don't like the javascript solution either, this is why i think i can solve this by cookies.

is there a way to retrieve all the tabids of the menu without rebuilding a query to the db and inner joining permissions and visibilities and taborder...?

The answer to your question is no.

There is no such thing as 'tabids for the menu'.  The menu is a derivative of the Tabs table generated dynamically at runtime for each page, it doesn't exist as a separate entity.  I think you should look at other ways of achieving your outcome and forget about the menu.

will this call the db or will it get it from earlier calls? i.e. how many calls do you think this will generate? 0?1? or n?

ArrayList tabs = new ArrayList();

 

for (int i = 0; i {
   DotnetNuke.Entities.Tabs.TabInfo tab = (DotnetNuke.Entities.Tabs.TabInfo)PortalSettings.DesktopTabsIdea [I];
   
if (tab.IsVisible && !tab.IsDeleted)
   {
      
if ((tab.StartDate < DateTime.Now && tab.EndDate > DateTime.Now) || AdminMode)  //bool SkinObjectBase.AdminMode
      {
         
if (DotnetNuke.Security.PortalSecurity.IsInRoles(tab.AuthorizedRoles))
         {
            tabs.Add(tab);
         }
      }
   }
}


The Desktop Tabs collection shoudl be cached, but you will need to check your database access by using a query analyzer tool to sniff the database traffic to your database to know for sure.  I think the code above will run without accessing the database.  My other suggestion is concentrate on overall page performance and not to worry too much about database access unless you are repackaging the module for use by other people when you don't have control over the number of tabs and traffic to their site.  If  you've got 10 tabs in your portal, it's not really going to matter much if you request that twice.  You can always build your desired tabs collection and cache it yourself so you know exactly when and why a query will be run. 

//Build list of tabs to be shown to user
 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0append a urlparameter to all tabs in the menu from the moduleappend a urlparameter to all tabs in the menu from the module


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