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.0Programmatically Add Tab (Page)Programmatically Add Tab (Page)
Previous
 
Next
New Post
8/17/2007 11:06 AM
 

Ok, I'm developing a vendor management module that also creates a tab (or page) for each vendor that is created.  In my code, I am executing a few dnn stored procedures to create the tab, and to add tab permissions.  I am manually setting the taborder afterwards by getting the last tab order for that parent and adding 2 to it. 

So here's the problem, the record is created in dbo.Tabs and in dbo.TabPermission but the tab doesn't show up in Admin/Pages or in the Navigation bar.  I can change skins to something else and then it shows up.  What am I doing wrong?

Thanks In Advance,
gOMER

 
New Post
8/17/2007 7:33 PM
 

Firstly - you should avoid directly call Core stored procedures
- you are asking for all sorts of trouble down the track with managability.

Instead you should handle this sort of thing thru the controllers built into DNN.

Dim objTabs As New TabController
Dim objTab As New TabInfo 

With objTab
   objTab.TabID = TabId
   objTab.PortalID = PortalId
   objTab.TabName = txtTabName.Text
   objTab.Title = txtTitle.Text
   objTab.Description = txtDescription.Text

    etc etc
   Making sure to set all the properties - especially expiry dates and isDeleted=False

End With

'Add the new tab
objTab.TabID = objTabs.AddTab(objTab)

'Update the UrlController
Dim objUrls As New UrlController
objUrls.UpdateUrl(PortalId, ctlURL.Url, ctlURL.UrlType, 0, Null.NullDate, Null.NullDate, ctlURL.Log, ctlURL.Track, Null.NullInteger, ctlURL.NewWindow)


' This is important - you need to make sure the cache is flush or the tab wont appear
DotNetNuke.Common.Utilities.DataCache.ClearModuleCache(TabId)

Westa

 
New Post
8/17/2007 8:58 PM
 

THANKS A MILLION!!! That did the trick!  And also I checked your referenced code from the dotnetnuke core code and learned more about it and you are exactly on the money! 

Thanks Again!
gOMER

 
New Post
10/11/2007 10:32 AM
 

When we try this code ctlUrl isn't defined in our context PortalModuleBase.  Did it used to be?  And it is abstract so we can't simply new() to get one.

Where is it/should it be defined?

Thanks.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Programmatically Add Tab (Page)Programmatically Add Tab (Page)


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