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 ...Creating Tabs DynamicallyCreating Tabs Dynamically
Previous
 
Next
New Post
1/29/2007 7:38 PM
 

Have a look at ManageTabs.ascx.vb:

Dim objTabs As New TabController
Dim objTab As New TabInfo
objTab.TabID = TabId
objTab.PortalID = PortalId
objTab.TabName = txtTabName.Text
objTab.Title = txtTitle.Text
objTab.Description = txtDescription.Text
objTab.KeyWords = txtKeyWords.Text
objTab.IsVisible = (Not chkHidden.Checked)
objTab.DisableLink = chkDisableLink.Checked
objTab.ParentId = Int32.Parse(cboTab.SelectedItem.Value)
objTab.IconFile = strIcon
objTab.IsDeleted = False
objTab.Url = ctlURL.Url
objTab.TabPermissions = dgPermissions.Permissions
objTab.SkinSrc = ctlSkin.SkinSrc
objTab.ContainerSrc = ctlContainer.SkinSrc
objTab.TabPath = GenerateTabPath(objTab.ParentId, objTab.TabName)
If txtStartDate.Text <> "" Then
   objTab.StartDate = Convert.ToDateTime(txtStartDate.Text)
Else
   objTab.StartDate = Null.NullDate
End If
If txtEndDate.Text <> "" Then
   objTab.EndDate = Convert.ToDateTime(txtEndDate.Text)
Else
   objTab.EndDate = Null.NullDate
End If
If txtRefreshInterval.Text.Length > 0 AndAlso IsNumeric(txtRefreshInterval.Text) Then
   objTab.RefreshInterval = Convert.ToInt32(txtRefreshInterval.Text)
End If
objTab.PageHeadText = txtPageHeadText.Text

objTab.TabID = objTabs.AddTab(objTab)


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/8/2007 6:10 PM
 

For now i just hardcoded some values and see the code below. im getting error on caching provider

void CreatePage_Click(object sender, EventArgs e)

{

TabController oObjTabs = new TabController();

TabInfo oObjInfo = new TabInfo();

oObjInfo.TabID = 61 ;

oObjInfo.PortalID = 0;

oObjInfo.TabName = "aaa"; 

oObjInfo.Title = "bbb";

oObjInfo.Description = "ccc";

oObjInfo.ParentId = 3;

 

oObjInfo.TabID = oObjTabs.AddTab(oObjInfo);

Label1.Text = "Tab Created";

}

 error from stack trace

  at DotNetNuke.Data.DataProvider.Instance()\r\n   at DotNetNuke.Entities.Tabs.TabController.GetTab(Int32 TabId) in C:\\DotNetNuke_DEV\\Library\\Components\\Tabs\\TabController.vb:line 480\r\n   at DotNetNuke.Common.Globals.GenerateTabPath(Int32 ParentId, String TabName) in C:\\DotNetNuke_DEV\\Library\\Components\\Shared\\Globals.vb:line 2163\r\n   at DotNetNuke.Entities.Tabs.TabController.AddTab(TabInfo objTab, Boolean AddAllTabsModules) in C:\\DotNetNuke_DEV\\Library\\Components\\Tabs\\TabController.vb:line 337\r\n   at DotNetNuke.Entities.Tabs.TabController.AddTab(TabInfo objTab) in C:\\DotNetNuke_DEV\\Library\\Components\\Tabs\\TabController.vb:line 329\r\n   at DotNetNuke.Modules.CreatePage.AddTab.CreatePage_Click(Object sender, EventArgs e) in c:\\Visual Studio 2005\\AddTab\\AddTab.ascx.cs:line 49"

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Creating Tabs DynamicallyCreating Tabs Dynamically


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