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.0Adding Modules to a Page with CodeAdding Modules to a Page with Code
Previous
 
Next
New Post
7/28/2009 8:36 AM
 

Ok here is my updated code - still not working. I'm not getting any errors (that I am aware of) - but the module is still not getting added to the page, and frankly I'm lost- and frustrated.

I would so appreciate some help if anyone can can spare the time.

 

[

WebMethod(Description = "Creates a new page")]public int CreatePage(string pageName, string content, string lang)TabController controller = new DotNetNuke.Entities.Tabs.TabController();TabInfo newTab = new DotNetNuke.Entities.Tabs.TabInfo();false;false;true;false;"";"";int newTabId = controller.AddTab(newTab); //add new page.

 

// clear cache

 

 

 

DataCache.ClearModuleCache(newTab.TabID);///Add module to newTab

DotNetNuke.Entities.Modules.

DotNetNuke.Entities.Modules.

modInfo.DisplayTitle =

modInfo.Header =

 

ModuleInfo modInfo = new DotNetNuke.Entities.Modules.ModuleInfo();ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();true;"header string";//modInfo.IsDefaultModule = true;//do we need this?

modInfo.Alignment =

modInfo.TabID = newTabId;

 

"ContentPane";//modInfo.DesktopModuleID = 68; //HTML text module

 

//modInfo.ModuleID = 68;

modInfo.PortalID = 0;

modInfo.EndDate = System.

modInfo.InheritViewPermissions =

modInfo.IsDefaultModule =

modInfo.ModuleOrder = 1;

modInfo.AllTabs =

 

modInfo.PaneName =

modInfo = mc.GetModuleByDefinition(0,

 

DateTime.Now.AddYears(10);true;true;false;"ContentPane";"Text/HTML"); int newModule=mc.AddModule(modInfo); //add module to the page

 

// clear cache

 

 

}

DataCache.ClearModuleCache(newTab.TabID);return newTabId;

 

{

DotNetNuke.Entities.Tabs.

DotNetNuke.Entities.Tabs.

newTab.PortalID = 0;

newTab.TabName = pageName;

newTab.Title = pageName;

newTab.Description = pageName;

newTab.KeyWords = pageName;

newTab.IsDeleted =

newTab.IsSuperTab =

newTab.IsVisible =

newTab.DisableLink =

newTab.IconFile =

newTab.Url =

 

 

 
New Post
7/28/2009 9:05 AM
 

OK I now have a new page with the HTML module being added! Yay!

The code is:

[

WebMethod(Description = "Creates a new page")]public int CreatePage(string pageName, string content, string lang)TabController controller = new DotNetNuke.Entities.Tabs.TabController();TabInfo newTab = new DotNetNuke.Entities.Tabs.TabInfo();false;false;true;false;"";"";int newTabId = controller.AddTab(newTab); //add new page.

 

// clear cache

 

 

 

DataCache.ClearModuleCache(newTab.TabID);///Add module to newTab

DotNetNuke.Entities.Modules.

DotNetNuke.Entities.Modules.

modInfo.DisplayTitle =

modInfo = mc.GetModuleByDefinition(0,

modInfo.Header =

 

ModuleInfo modInfo = new DotNetNuke.Entities.Modules.ModuleInfo();ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();true;"Text/HTML"); "header string";//modInfo.IsDefaultModule = true;//do we need this?

modInfo.PaneName =

modInfo.TabID = newTabId;

 

"ContentPane";//modInfo.DesktopModuleID = 68; //HTML text module

 

//modInfo.ModuleID = 68;

modInfo.PortalID = 0;

modInfo.EndDate = System.

modInfo.InheritViewPermissions =

modInfo.IsDefaultModule =

modInfo.ModuleOrder = 1;

modInfo.AllTabs =

 

modInfo.PaneName =

 

 

DateTime.Now.AddYears(10);true;true;false;"ContentPane";int newModule=mc.AddModule(modInfo); //add module to the page

 

// clear cache

 

 

}

DataCache.ClearModuleCache(newTab.TabID);return newTabId;

 

Now, what I need to figure out is how to set the content for the HTML module?

 

{

DotNetNuke.Entities.Tabs.

DotNetNuke.Entities.Tabs.

newTab.PortalID = 0;

newTab.TabName = pageName;

newTab.Title = pageName;

newTab.Description = pageName;

newTab.KeyWords = pageName;

newTab.IsDeleted =

newTab.IsSuperTab =

newTab.IsVisible =

newTab.DisableLink =

newTab.IconFile =

newTab.Url =

 

 

 
New Post
9/3/2010 11:27 AM
 
Hey Magick, so sorry I missed you questions!  Apparently I didn't have this thread on Notify.  Looks like you figured it out though it was a pain at times.  It always feels good when it finally works.

-something clever or funny.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding Modules to a Page with CodeAdding Modules to a Page with Code


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