Table of Contents
GetCurrentPortalId

Description: Gets the ID of the currently active portal.

Signature
public static int GetCurrentPortalId()
DeletePortal

Description: Deletes a portal by its ID.

Signature
public static void DeletePortal(int portalId)
CreatePortal

Description: Creates a new portal with the specified name and alias. Returns the new portal ID.

Signature
public static int CreatePortal(string portalName, string strPortalAlias, int userId = -1, string description = "NewPortal", string cultureCode = "en-US", bool useEmailAsUserName = true)
Parameters
  • portalName (string)
  • strPortalAlias (string)
  • userId (int) — optional, defaults to -1
  • description (string) — optional, defaults to "NewPortal"
  • cultureCode (string) — optional, defaults to "en-US"
  • useEmailAsUserName (bool) — optional, defaults to true
BuildPortal

Description: Builds a portal from a config file, associating it with the specified admin user.

Signature
public static void BuildPortal(int portalid, int portalAdminUserId, string buildconfigfile)
Parameters
  • portalid (int)
  • portalAdminUserId (int)
  • buildconfigfile (string)
BuildDefaultSystems

Description: Builds and registers the default Rocket systems for a portal.

Signature
public static void BuildDefaultSystems(int portalId)
Parameters
  • portalId (int)
ActivateSystem

Description: Activates a Rocket system on the specified portal.

Signature
public static void ActivateSystem(int portalId, SystemLimpet systemData, SimplisityInfo postInfo = null)
Parameters
  • portalId (int)
  • systemData (SystemLimpet)
  • postInfo (SimplisityInfo) — optional
GetPortals

Description: Returns a list of all portal IDs in the DNN installation.

Signature
public static List<int> GetPortals()
GetPortalId

Description: Gets the portal ID of the current portal context.

Signature
public static int GetPortalId()
GetPortalIdBySiteKey

Description: Looks up a portal ID by its site key.

Signature
public static int GetPortalIdBySiteKey(string siteKey)
Parameters
  • siteKey (string)
GetPortal

Description: Returns the DNN PortalInfo object for the specified portal ID.

Signature
public static PortalInfo GetPortal(int portalId)
Parameters
  • portalId (int)
GetPortalName

Description: Returns the display name of the specified portal.

Signature
public static String GetPortalName(int portalId)
Parameters
  • portalId (int)
Registration

Description: Sets the portal registration type. Values: NoRegistration = 0, PrivateRegistration = 1, PublicRegistration = 2, VerifiedRegistration = 3.

Signature
public static void Registration(int portalId, int regType)
Parameters
  • portalId (int)
  • regType (int) — NoRegistration = 0, PrivateRegistration = 1, PublicRegistration = 2, VerifiedRegistration = 3
EnablePopups

Description: Enables or disables popup windows for the specified portal.

Signature
public static void EnablePopups(int portalId, bool value)
Parameters
  • portalId (int)
  • value (bool)
SSLSetup

Description: Configures the SSL setting for the specified portal.

Signature
public static void SSLSetup(int portalId, int value)
Parameters
  • portalId (int)
  • value (int)
PageHeadTextUpdate

Description: Replaces the page head text (custom HTML injected into the <head> tag) for the specified portal.

Signature
public static void PageHeadTextUpdate(int portalId, string value)
Parameters
  • portalId (int)
  • value (string)
PageHeadTextAppend

Description: Appends text to the page head (custom HTML injected into the <head> tag) for the specified portal.

Signature
public static void PageHeadTextAppend(int portalId, string value)
Parameters
  • portalId (int)
  • value (string)
UpdatePortalSetting

Description: Saves or updates a named portal setting value.

Signature
public static void UpdatePortalSetting(int portalId, string settingName, string settingValue)
Parameters
  • portalId (int)
  • settingName (string)
  • settingValue (string)
UseEmailAsUserName

Description: Configures whether the portal uses email addresses as usernames.

Signature
public static void UseEmailAsUserName(int portalId, bool value)
Parameters
  • portalId (int)
  • value (bool)
GetPortalSettings (current portal)

Description: Returns the DNN PortalSettings for the current portal context.

Signature
public static PortalSettings GetPortalSettings()
GetPortalSettings (by portal ID)

Description: Returns the DNN PortalSettings for the specified portal ID.

Signature
public static PortalSettings GetPortalSettings(int portalId)
Parameters
  • portalId (int)
EditorTemplate

Description: Returns the configured editor template name for the current portal.

Signature
public static string EditorTemplate()
LoginTabId (by portal ID)

Description: Returns the tab (page) ID of the login page for the specified portal.

Signature
public static int LoginTabId(int portalId)
Parameters
  • portalId (int)
LoginTabId (current portal)

Description: Returns the tab (page) ID of the login page for the current portal.

Signature
public static int LoginTabId()
GetPortalByModuleID

Description: Returns the portal ID that hosts the specified module.

Signature
public static int GetPortalByModuleID(int moduleId)
Parameters
  • moduleId (int)
GetAllPortalIds

Description: Returns a list of all portal IDs across the entire DNN installation.

Signature
public static List<int> GetAllPortalIds()
GetAllPortalRecords

Description: Returns a list of SimplisityRecord objects representing all portals.

Signature
public static List<SimplisityRecord> GetAllPortalRecords()
CreatePortalFolder

Description: Creates a folder within the portal's file system using the DNN folder API.

Signature
public static void CreatePortalFolder(DotNetNuke.Entities.Portals.PortalSettings PortalSettings, string FolderName)
Parameters
  • PortalSettings (DotNetNuke.Entities.Portals.PortalSettings)
  • FolderName (string)
SetUserRegistration

Description: Sets the user registration mode for the portal (numeric value).

Signature
public static void SetUserRegistration(int portalId, int value)
Parameters
  • portalId (int)
  • value (int)
GetUserRegistration

Description: Returns the current user registration mode value for the portal.

Signature
public static int GetUserRegistration(int portalId)
Parameters
  • portalId (int)
GetCurrentPortalSettings

Description: Returns the DNN PortalSettings for the currently active portal context.

Signature
public static PortalSettings GetCurrentPortalSettings()
GetDomainFromUrl

Description: Extracts the domain name from a full URL string.

Signature
public static string GetDomainFromUrl(string url)
Parameters
  • url (string)
GetPortalAliasesWithCultureCode

Description: Returns a dictionary mapping portal aliases to their culture codes for the specified portal.

Signature
public static Dictionary<string, string> GetPortalAliasesWithCultureCode(int portalId)
Parameters
  • portalId (int)
GetPortalAliases

Description: Returns a list of all portal aliases (hostnames) for the specified portal.

Signature
public static List<string> GetPortalAliases(int portalId)
Parameters
  • portalId (int)
DefaultPortalAlias (by portal ID)

Description: Returns the default portal alias for the specified portal. Uses the current portal if portalId is -1.

Signature
public static string DefaultPortalAlias(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
DefaultPortalAlias (by portal ID and culture)

Description: Returns the default portal alias for the specified portal and culture code.

Signature
public static string DefaultPortalAlias(int portalId, string cultureCode)
Parameters
  • portalId (int)
  • cultureCode (string)
AddPortalAlias

Description: Adds a new portal alias, optionally associated with a culture code.

Signature
public static void AddPortalAlias(int portalId, string portalAlias, string cultureCode = "")
Parameters
  • portalId (int)
  • portalAlias (string)
  • cultureCode (string) — optional
DeletePortalAlias

Description: Removes a portal alias from the specified portal.

Signature
public static void DeletePortalAlias(int portalId, string portalAlias)
Parameters
  • portalId (int)
  • portalAlias (string)
SetPrimaryPortalAlias

Description: Sets or unsets the primary flag on a portal alias.

Signature
public static void SetPrimaryPortalAlias(int portalId, string portalAlias, bool isPrimary)
Parameters
  • portalId (int)
  • portalAlias (string)
  • isPrimary (bool)
SetSearchTabId

Description: Sets the tab (page) ID used as the search results page for the specified portal.

Signature
public static void SetSearchTabId(int portalId, int tabId)
Parameters
  • portalId (int)
  • tabId (int)
SetDefaultLanguage

Description: Sets the default language (culture code) for the specified portal.

Signature
public static void SetDefaultLanguage(int portalId, string cultureCode)
Parameters
  • portalId (int)
  • cultureCode (string)
GetDefaultLanguage

Description: Returns the default culture code (language) for the specified portal.

Signature
public static string GetDefaultLanguage(int portalId)
Parameters
  • portalId (int)
RootDomain

Description: Returns the root domain (hostname only) for the specified portal. Uses the current portal if portalId is -1.

Signature
public static string RootDomain(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
DomainSubUrl

Description: Returns the sub-URL path component of the portal domain. Uses the current portal if portalId is -1.

Signature
public static string DomainSubUrl(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
GetPortalAlias

Description: Returns the portal alias for the specified language/culture. Uses the current portal if portalid is -1.

Signature
public static string GetPortalAlias(string lang, int portalid = -1)
Parameters
  • lang (string)
  • portalid (int) — optional, defaults to -1
GetPortalIdByAlias

Description: Looks up the portal ID for a given portal alias string.

Signature
public static int GetPortalIdByAlias(string portalAlias)
Parameters
  • portalAlias (string)
HomeDNNrocketDirectoryMapPath

Description: Returns the physical server path to the portal's DNNrocket home directory. Uses the current portal if portalId is -1.

Signature
public static string HomeDNNrocketDirectoryMapPath(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
HomeDNNrocketDirectoryRel

Description: Returns the relative URL path to the portal's DNNrocket home directory. Uses the current portal if portalId is -1.

Signature
public static string HomeDNNrocketDirectoryRel(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
DNNrocketThemesDirectoryMapPath

Description: Returns the physical server path to the portal's DNNrocket themes directory. Uses the current portal if portalId is -1.

Signature
public static string DNNrocketThemesDirectoryMapPath(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
DNNrocketThemesDirectoryRel

Description: Returns the relative URL path to the portal's DNNrocket themes directory. Uses the current portal if portalId is -1.

Signature
public static string DNNrocketThemesDirectoryRel(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
TempDirectoryMapPath

Description: Returns the physical server path to the portal's temp directory. Uses the current portal if portalId is -1.

Signature
public static string TempDirectoryMapPath(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
BackUpDirectoryMapPath

Description: Returns the physical server path to the portal's backup directory. Uses the current portal if portalId is -1.

Signature
public static string BackUpDirectoryMapPath(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
TempDirectoryRel

Description: Returns the relative URL path to the portal's temp directory. Uses the current portal if portalId is -1.

Signature
public static string TempDirectoryRel(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
HomeDirectoryMapPath

Description: Returns the physical server path to the portal's home (Portals/{id}/) directory.

Signature
public static string HomeDirectoryMapPath(int portalId)
Parameters
  • portalId (int)
AddLanguage

Description: Adds a language (culture) to the specified portal.

Signature
public static void AddLanguage(int portalId, string cultureCode)
Parameters
  • portalId (int)
  • cultureCode (string)
RemoveLanguage

Description: Removes a language (culture) from the specified portal.

Signature
public static void RemoveLanguage(int portalId, string cultureCode)
Parameters
  • portalId (int)
  • cultureCode (string)
UpdatePortalCopyright

Description: Updates the copyright message (footer text) for the specified portal.

Signature
public static void UpdatePortalCopyright(int portalId, string copyrightMessage)
Parameters
  • portalId (int) — The portal ID
  • copyrightMessage (string) — The new copyright message
GetRootDomainUrl

Description: Returns the full root domain URL (including scheme) for the specified portal. Uses the current portal if portalId is -1.

Signature
public static string GetRootDomainUrl(int portalId = -1)
Parameters
  • portalId (int) — optional, defaults to -1
ClearPortalContent

Description: Clears all Rocket content data for the specified portal.

Signature
public static void ClearPortalContent(int portalId)
Parameters
  • portalId (int)
GetCurrentPageSkinCssPath

Description: Returns the relative URL path to the CSS file for the skin applied to the current page.

Signature
public static string GetCurrentPageSkinCssPath()
GetCurrentPortalCssPath

Description: Returns the relative URL path to the portal.css file for the current portal (/Portals/{portalId}/portal.css).

Signature
public static string GetCurrentPortalCssPath()
GetEffectiveSkinSrcForCurrentPage

Description: Returns the effective skin source path for the current page, resolving portal and page-level skin settings.

Signature
public static string GetEffectiveSkinSrcForCurrentPage()
GetPortalThemeSkinSrc

Description: Returns the skin source path configured as the portal-level default theme for the specified portal.

Signature
public static string GetPortalThemeSkinSrc(int portalId)
Parameters
  • portalId (int)
GetCurrentScheme

Description: Returns the current HTTP scheme (e.g. "http" or "https") for the active request.

Signature
public static string GetCurrentScheme()
GetCurrentBaseUrl

Description: Returns the base URL (scheme + domain) for the current request.

Signature
public static string GetCurrentBaseUrl()