• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class Globals

The global instance of DotNetNuke. all basic functions and properties are defined in this instance.

Inheritance
System.Object
Globals
Namespace: DotNetNuke.Common
Assembly: DotNetNuke.dll
Syntax
public sealed class Globals : object

Fields

| Improve this Doc View Source

BaseTagRegex

Validates if a tag is an html 'base' tag.

Declaration
public static readonly Regex BaseTagRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

EmailValidatorRegex

Validates for a valid email address.

Declaration
public static readonly Regex EmailValidatorRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

FileEscapingRegex

Finds common file escaping characters.

Declaration
public static readonly Regex FileEscapingRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

FileExtensionRegex

Checks if a string is a valid Windows file extension.

Declaration
public static readonly Regex FileExtensionRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

FileValidNameRegex

Checks if a string is a valid Windows filename.

Declaration
public static readonly Regex FileValidNameRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

glbAboutPage

About page name.

Declaration
public const string glbAboutPage = null
Field Value
Type Description
System.String

about.htm.

| Improve this Doc View Source

glbAllowControlPanelToDetermineVisibility

Default setting to determine if selected control panel is loaded to evaluate visibility.

Declaration
public const bool glbAllowControlPanelToDetermineVisibility = null
Field Value
Type Description
System.Boolean

false.

| Improve this Doc View Source

glbConfigFolder

Config files folder.

Declaration
public const string glbConfigFolder = null
Field Value
Type Description
System.String

\Config.

| Improve this Doc View Source

glbContainersPath

Default container folder.

Declaration
public const string glbContainersPath = null
Field Value
Type Description
System.String

Portals/_default/Containers/.

| Improve this Doc View Source

glbDefaultControlPanel

Default control panel.

Declaration
public const string glbDefaultControlPanel = null
Field Value
Type Description
System.String

Admin/ControlPanel/IconBar.ascx.

| Improve this Doc View Source

glbDefaultPage

Default page name.

Declaration
public const string glbDefaultPage = null
Field Value
Type Description
System.String

Default.aspx.

| Improve this Doc View Source

glbDefaultPane

Default pane name.

Declaration
public const string glbDefaultPane = null
Field Value
Type Description
System.String

ContentPane.

| Improve this Doc View Source

glbDotNetNukeConfig

DotNetNuke config file.

Declaration
public const string glbDotNetNukeConfig = null
Field Value
Type Description
System.String

DotNetNuke.config.

| Improve this Doc View Source

glbEmailRegEx

Email address regex pattern.

Declaration
public const string glbEmailRegEx = null
Field Value
Type Description
System.String

^[a-zA-Z0-9_%+#&'/=^{|}~-](?:\.?[a-zA-Z0-9_%+#&'*/=^{|}~-])@(?:a-zA-Z0-9_*.[a-zA-Z]{2,9}|[(?:2[0-4]\d|25[0-5]|[01]?\d\d?).(?:2[0-4]\d|25[0-5]|[01]?\d\d?).(?:2[0-4]\d|25[0-5]|[01]?\d\d?).(?:2[0-4]\d|25[0-5]|[01]?\d\d?)])$

| Improve this Doc View Source

glbHostSkinFolder

Default host skin folder.

Declaration
public const string glbHostSkinFolder = null
Field Value
Type Description
System.String

_default.

| Improve this Doc View Source

glbProtectedExtension

extension of protected files.

Declaration
public const string glbProtectedExtension = null
Field Value
Type Description
System.String

.resources.

| Improve this Doc View Source

glbRoleAllUsers

Global role id for all users.

Declaration
public const string glbRoleAllUsers = null
Field Value
Type Description
System.String

-1.

| Improve this Doc View Source

glbRoleAllUsersName

Global role name for all users.

Declaration
public const string glbRoleAllUsersName = null
Field Value
Type Description
System.String

All Users.

| Improve this Doc View Source

glbRoleNothing

Global role id by default.

Declaration
public const string glbRoleNothing = null
Field Value
Type Description
System.String

-4.

| Improve this Doc View Source

glbRoleSuperUser

Global role id for super user.

Declaration
public const string glbRoleSuperUser = null
Field Value
Type Description
System.String

-2.

| Improve this Doc View Source

glbRoleSuperUserName

Global ro name for super user.

Declaration
public const string glbRoleSuperUserName = null
Field Value
Type Description
System.String

Superuser.

| Improve this Doc View Source

glbRoleUnauthUser

Global role id for unauthenticated users.

Declaration
public const string glbRoleUnauthUser = null
Field Value
Type Description
System.String

-3.

| Improve this Doc View Source

glbRoleUnauthUserName

Global role name for unauthenticated users.

Declaration
public const string glbRoleUnauthUserName = null
Field Value
Type Description
System.String

Unauthenticated Users.

| Improve this Doc View Source

glbScriptFormat

Format of a script tag.

Declaration
public const string glbScriptFormat = null
Field Value
Type Description
System.String

<script type=&quot;text/javascript&quot; src=&quot;{0}&quot; ></script>

| Improve this Doc View Source

glbSkinsPath

Default skin folder.

Declaration
public const string glbSkinsPath = null
Field Value
Type Description
System.String

Portals/_default/Skins/.

| Improve this Doc View Source

glbSuperUserAppName

Default portal id for super user.

Declaration
public const int glbSuperUserAppName = null
Field Value
Type Description
System.Int32

-1.

| Improve this Doc View Source

glbUserNameMinLength

User Name default minimum length.

Declaration
public const int glbUserNameMinLength = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

glbUserNameRegEx

User Name regex pattern.

Declaration
public const string glbUserNameRegEx = null
Field Value
Type Description
System.String
| Improve this Doc View Source

InvalidCharacters

Finds any character that is not a letter, a number, an underscore or a dash.

Declaration
public static readonly Regex InvalidCharacters
Field Value
Type Description
Regex
| Improve this Doc View Source

InvalidInitialCharacters

Validates if the first character is a letter.

Declaration
public static readonly Regex InvalidInitialCharacters
Field Value
Type Description
Regex
| Improve this Doc View Source

NonAlphanumericCharacters

Finds non-alphanumeric characters.

Declaration
public static readonly Regex NonAlphanumericCharacters
Field Value
Type Description
Regex
| Improve this Doc View Source

NumberMatchRegex

Validates if the string contains only numbers.

Declaration
public static readonly Regex NumberMatchRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

ServicesFrameworkRegex

Checks if a url part is a valid services framework url.

Declaration
public static readonly Regex ServicesFrameworkRegex
Field Value
Type Description
Regex
| Improve this Doc View Source

USERNAME_UNALLOWED_ASCII

Checks for invalid usernames.

Declaration
public static readonly string USERNAME_UNALLOWED_ASCII
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

ApplicationMapPath

Gets the application map path.

Declaration
public static string ApplicationMapPath { get; }
Property Value
Type Description
System.String

The application map path.

| Improve this Doc View Source

ApplicationPath

Gets the application path.

Declaration
public static string ApplicationPath { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

DatabaseEngineVersion

Gets or sets the database engine version.

Declaration
public static Version DatabaseEngineVersion { get; set; }
Property Value
Type Description
Version

The database engine version.

| Improve this Doc View Source

DataBaseVersion

Gets the database version.

Declaration
public static Version DataBaseVersion { get; }
Property Value
Type Description
Version
| Improve this Doc View Source

DesktopModulePath

Gets the desktop module path.

Declaration
public static string DesktopModulePath { get; }
Property Value
Type Description
System.String

ApplicationPath + "/DesktopModules/".

| Improve this Doc View Source

ElapsedSinceAppStart

Gets a value indicating for how long the application has been running.

Declaration
public static TimeSpan ElapsedSinceAppStart { get; }
Property Value
Type Description
TimeSpan
| Improve this Doc View Source

glbImageFileTypes

Gets image file types.

Declaration
public static string glbImageFileTypes { get; }
Property Value
Type Description
System.String

Values read from ImageTypes List. If there is not List, default values will be jpg,jpeg,jpe,gif,bmp,png,svg,ico.

| Improve this Doc View Source

HostMapPath

Gets the host map path.

Declaration
public static string HostMapPath { get; }
Property Value
Type Description
System.String

ApplicationMapPath + "Portals_default&quot;.

| Improve this Doc View Source

HostPath

Gets the host path.

Declaration
public static string HostPath { get; }
Property Value
Type Description
System.String

ApplicationPath + "/Portals/_default/".

| Improve this Doc View Source

IISAppName

Gets or sets the name of the IIS app.

Declaration
public static string IISAppName { get; set; }
Property Value
Type Description
System.String

request.ServerVariables["APPL_MD_PATH"].

| Improve this Doc View Source

ImageFileTypes

Gets image file types.

Declaration
public static string ImageFileTypes { get; }
Property Value
Type Description
System.String

Values read from ImageTypes List. If there is not List, default values will be jpg,jpeg,jpe,gif,bmp,png,svg,ico.

| Improve this Doc View Source

ImagePath

Gets the image path.

Declaration
public static string ImagePath { get; }
Property Value
Type Description
System.String

ApplicationPath + "/Images/".

| Improve this Doc View Source

InstallMapPath

Gets the install map path.

Declaration
public static string InstallMapPath { get; }
Property Value
Type Description
System.String

server map path of InstallPath.

| Improve this Doc View Source

InstallPath

Gets the install path.

Declaration
public static string InstallPath { get; }
Property Value
Type Description
System.String

ApplicationPath + "/Install/".

| Improve this Doc View Source

NETFrameworkVersion

Gets or sets the NET framework version.

Declaration
public static Version NETFrameworkVersion { get; set; }
Property Value
Type Description
Version

The NET framework version.

| Improve this Doc View Source

OperatingSystemVersion

Gets or sets the operating system version.

Declaration
public static Version OperatingSystemVersion { get; set; }
Property Value
Type Description
Version

The operating system version.

| Improve this Doc View Source

ServerName

Gets or sets the name of the server.

Declaration
public static string ServerName { get; set; }
Property Value
Type Description
System.String

server name in config file or the server's marchine name.

| Improve this Doc View Source

Status

Gets the status of application.

Declaration
public static Globals.UpgradeStatus Status { get; }
Property Value
Type Description
Globals.UpgradeStatus

Methods

| Improve this Doc View Source

AccessDeniedURL()

Get the URL to show the "access denied" message.

Declaration
public static string AccessDeniedURL()
Returns
Type Description
System.String

URL to access denied view.

| Improve this Doc View Source

AccessDeniedURL(String)

Get the URL to show the "access denied" message.

Declaration
public static string AccessDeniedURL(string message)
Parameters
Type Name Description
System.String message

The message to display.

Returns
Type Description
System.String

URL to access denied view.

| Improve this Doc View Source

AddHTTP(String)

Adds the current request's protocol ("http://" or "https://") to the given URL, if it does not already have a protocol specified.

Declaration
public static string AddHTTP(string strURL)
Parameters
Type Name Description
System.String strURL

The URL.

Returns
Type Description
System.String

The formatted URL.

| Improve this Doc View Source

AddPort(String, String)

Adds the port.

Declaration
public static string AddPort(string httpAlias, string originalUrl)
Parameters
Type Name Description
System.String httpAlias

The HTTP alias.

System.String originalUrl

The original URL.

Returns
Type Description
System.String

url with port if the post number is not 80.

| Improve this Doc View Source

ApplicationURL()

Generates the Application root url (including the tab/page).

Declaration
public static string ApplicationURL()
Returns
Type Description
System.String

The formatted root url.

Remarks

This overload assumes the current page.

| Improve this Doc View Source

ApplicationURL(Int32)

Generates the Application root url (including the tab/page).

Declaration
public static string ApplicationURL(int tabID)
Parameters
Type Name Description
System.Int32 tabID

The id of the tab/page.

Returns
Type Description
System.String

The formatted root url.

Remarks

This overload takes the tabid (page id) as a parameter.

| Improve this Doc View Source

BuildCrossTabDataSet(String, IDataReader, String, String, String, String, String, String, String, CultureInfo)

converts a data reader with serialized fields into a typed data set.

Declaration
public static DataSet BuildCrossTabDataSet(string dataSetName, IDataReader result, string fixedColumns, string variableColumns, string keyColumn, string fieldColumn, string fieldTypeColumn, string stringValueColumn, string numericValueColumn, CultureInfo culture)
Parameters
Type Name Description
System.String dataSetName

Name of the dataset to be created.

IDataReader result

Data reader that contains all field values serialized.

System.String fixedColumns

List of fixed columns, delimited by commas. Columns must be contained in DataReader.

System.String variableColumns

List of variable columns, delimited by commas. Columns must be contained in DataReader.

System.String keyColumn

Name of the column, that contains the row ID. Column must be contained in DataReader.

System.String fieldColumn

Name of the column, that contains the field name. Column must be contained in DataReader.

System.String fieldTypeColumn

Name of the column, that contains the field type name. Column must be contained in DataReader.

System.String stringValueColumn

Name of the column, that contains the field value, if stored as string. Column must be contained in DataReader.

System.String numericValueColumn

Name of the column, that contains the field value, if stored as number. Column must be contained in DataReader.

CultureInfo culture

culture of the field values in data reader's string value column.

Returns
Type Description
DataSet

The generated DataSet.

| Improve this Doc View Source

BuildCrossTabDataSet(String, IDataReader, String, String, String, String, String, String, String)

Builds the cross tab dataset.

Declaration
public static DataSet BuildCrossTabDataSet(string dataSetName, IDataReader result, string fixedColumns, string variableColumns, string keyColumn, string fieldColumn, string fieldTypeColumn, string stringValueColumn, string numericValueColumn)
Parameters
Type Name Description
System.String dataSetName

Name of the data set.

IDataReader result

The result.

System.String fixedColumns

The fixed columns.

System.String variableColumns

The variable columns.

System.String keyColumn

The key column.

System.String fieldColumn

The field column.

System.String fieldTypeColumn

The field type column.

System.String stringValueColumn

The string value column.

System.String numericValueColumn

The numeric value column.

Returns
Type Description
DataSet

the dataset instance.

| Improve this Doc View Source

CleanFileName(String, String, String)

Cleans the name of the file.

Declaration
public static string CleanFileName(string fileName, string badChars, string replaceChar)
Parameters
Type Name Description
System.String fileName

Name of the file.

System.String badChars

The bad chars.

System.String replaceChar

The replace char.

Returns
Type Description
System.String

clean name.

| Improve this Doc View Source

CleanFileName(String, String)

Cleans the name of the file.

Declaration
public static string CleanFileName(string fileName, string badChars)
Parameters
Type Name Description
System.String fileName

Name of the file.

System.String badChars

The bad chars.

Returns
Type Description
System.String

clean name.

| Improve this Doc View Source

CleanFileName(String)

Cleans the name of the file.

Declaration
public static string CleanFileName(string fileName)
Parameters
Type Name Description
System.String fileName

Name of the file.

Returns
Type Description
System.String

clean name.

| Improve this Doc View Source

CleanName(String)

CleanName - removes characters from Module/Tab names that are being used for file names in Module/Tab Import/Export.

Declaration
public static string CleanName(string name)
Parameters
Type Name Description
System.String name

The name to clean.

Returns
Type Description
System.String

A cleaned string.

| Improve this Doc View Source

CloakText(String)

Cloaks the text, obfuscate sensitive data to prevent collection by robots and spiders and crawlers.

Declaration
public static string CloakText(string personalInfo)
Parameters
Type Name Description
System.String personalInfo

The personal info.

Returns
Type Description
System.String

obfuscated sensitive data by hustling ASCII characters.

| Improve this Doc View Source

ConvertDataReaderToDataSet(IDataReader)

Converts the datareader to dataset.

Declaration
public static DataSet ConvertDataReaderToDataSet(IDataReader reader)
Parameters
Type Name Description
IDataReader reader

The reader.

Returns
Type Description
DataSet

the dataset instance.

| Improve this Doc View Source

ConvertDataReaderToDataTable(IDataReader, Boolean)

Converts the datareader to datatable.

Declaration
public static DataTable ConvertDataReaderToDataTable(IDataReader reader, bool closeReader)
Parameters
Type Name Description
IDataReader reader

The reader.

System.Boolean closeReader

Whether close reader.

Returns
Type Description
DataTable

the datatable instance.

| Improve this Doc View Source

ConvertDataReaderToDataTable(IDataReader)

Converts the datareader to datatable.

Declaration
public static DataTable ConvertDataReaderToDataTable(IDataReader reader)
Parameters
Type Name Description
IDataReader reader

The reader.

Returns
Type Description
DataTable

the datatable instance.

| Improve this Doc View Source

CreateRSS(IDataReader, String, String, String, String, String, String)

Creates the RSS.

Declaration
public static void CreateRSS(IDataReader dr, string titleField, string urlField, string createdDateField, string syndicateField, string domainName, string fileName)
Parameters
Type Name Description
IDataReader dr

The dr.

System.String titleField

The title field.

System.String urlField

The URL field.

System.String createdDateField

The created date field.

System.String syndicateField

The syndicate field.

System.String domainName

Name of the domain.

System.String fileName

Name of the file.

| Improve this Doc View Source

CreateValidClass(String, Boolean)

CreateValidClass - removes characters from Module/Tab names which are invalid for use as an XHTML class attribute / CSS class selector value and optionally prepends the letter 'A' if the first character is not alphabetic. This differs from CreateValidID which replaces invalid characters with an underscore and replaces the first letter with an 'A' if it is not alphabetic.

Declaration
public static string CreateValidClass(string inputValue, bool validateFirstChar)
Parameters
Type Name Description
System.String inputValue

String to use to create the class value.

System.Boolean validateFirstChar

If set true, validate whether the first character is alphabetic and, if not, prepend the letter 'A' to the returned value.

Returns
Type Description
System.String

A string suitable for use as a class value.

| Improve this Doc View Source

CreateValidID(String)

Creates the valid ID.

Declaration
public static string CreateValidID(string inputValue)
Parameters
Type Name Description
System.String inputValue

The input value.

Returns
Type Description
System.String

String with a valid ID.

| Improve this Doc View Source

DateToString(DateTime)

Dates to string.

Declaration
public static string DateToString(DateTime dateValue)
Parameters
Type Name Description
DateTime dateValue

The date value.

Returns
Type Description
System.String

return value of input with SortableDateTimePattern.

| Improve this Doc View Source

DeleteFilesRecursive(String, String)

Deletes the files recursive which match the filter, will not delete folders and will ignore folder which is hidden or system.

Declaration
public static void DeleteFilesRecursive(string strRoot, string filter)
Parameters
Type Name Description
System.String strRoot

The root.

System.String filter

The filter.

| Improve this Doc View Source

DeleteFolderRecursive(String)

Deletes the folder recursive, include the folder itself will be deleted.

Declaration
public static void DeleteFolderRecursive(string strRoot)
Parameters
Type Name Description
System.String strRoot

The root.

| Improve this Doc View Source

DeserializeHashTableBase64(String)

DeserializeHashTableBase64 deserializes a Hashtable using Binary Formatting.

Declaration
public static Hashtable DeserializeHashTableBase64(string source)
Parameters
Type Name Description
System.String source

The String Source to deserialize.

Returns
Type Description
Hashtable

The deserialized Hashtable.

Remarks

While this method of serializing is no longer supported (due to Medium Trust issue, it is still required for upgrade purposes.

| Improve this Doc View Source

DeserializeHashTableXml(String)

DeserializeHashTableXml deserializes a Hashtable using Xml Serialization.

Declaration
public static Hashtable DeserializeHashTableXml(string source)
Parameters
Type Name Description
System.String source

The String Source to deserialize.

Returns
Type Description
Hashtable

The deserialized Hashtable.

Remarks

This is the preferred method of serialization under Medium Trust.

| Improve this Doc View Source

EncodeReservedCharacters(String)

Encodes the reserved characters.

Declaration
public static string EncodeReservedCharacters(string queryString)
Parameters
Type Name Description
System.String queryString

The query string.

Returns
Type Description
System.String

Encoded content.

| Improve this Doc View Source

FindControlRecursive(Control, String)

Finds the control recursive from child to parent.

Declaration
public static Control FindControlRecursive(Control objControl, string strControlName)
Parameters
Type Name Description
Control objControl

current control.

System.String strControlName

the control name which want to find out.

Returns
Type Description
Control

control which'name is strControlName, or else return null if didn't match any control.

| Improve this Doc View Source

FindControlRecursiveDown(Control, String)

Searches control hierarchy from top down to find a control matching the passed in name.

Declaration
public static Control FindControlRecursiveDown(Control objParent, string strControlName)
Parameters
Type Name Description
Control objParent

Root control to begin searching.

System.String strControlName

Name of control to look for.

Returns
Type Description
Control

The found control or null.

Remarks

This differs from FindControlRecursive in that it looks down the control hierarchy, whereas, the FindControlRecursive starts at the passed in control and walks the tree up. Therefore, this function is more a expensive task.

| Improve this Doc View Source

FindDatabaseVersion(Int32, Int32, Int32)

Finds the database version.

Declaration
public static bool FindDatabaseVersion(int major, int minor, int build)
Parameters
Type Name Description
System.Int32 major

The major.

System.Int32 minor

The minor.

System.Int32 build

The build.

Returns
Type Description
System.Boolean

return true if can find the specific version, otherwise will retur false.

| Improve this Doc View Source

FormatAddress(Object, Object, Object, Object, Object, Object)

Formats the address on a single line ( ie. Unit, Street, City, Region, Country, PostalCode ).

Declaration
public static string FormatAddress(object unit, object street, object city, object region, object country, object postalCode)
Parameters
Type Name Description
System.Object unit

The unit.

System.Object street

The street.

System.Object city

The city.

System.Object region

The region.

System.Object country

The country.

System.Object postalCode

The postal code.

Returns
Type Description
System.String

A string containing the whole address on a single line.

| Improve this Doc View Source

FormatEmail(String)

Formats an email address as a cloacked html link.

Declaration
public static string FormatEmail(string email)
Parameters
Type Name Description
System.String email

The formatted email address.

Returns
Type Description
System.String

A cloacked html link.

| Improve this Doc View Source

FormatHelpUrl(String, PortalSettings, String, String)

Formats the help URL, adding query-string parameters and a protocol (if missing).

Declaration
public static string FormatHelpUrl(string helpUrl, PortalSettings objPortalSettings, string name, string version)
Parameters
Type Name Description
System.String helpUrl

The help URL.

PortalSettings objPortalSettings

The portal settings.

System.String name

The name of the module.

System.String version

The version of the module.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

FormatHelpUrl(String, PortalSettings, String)

Formats the help URL, adding query-string parameters and a protocol (if missing).

Declaration
public static string FormatHelpUrl(string helpUrl, PortalSettings objPortalSettings, string name)
Parameters
Type Name Description
System.String helpUrl

The help URL.

PortalSettings objPortalSettings

The portal settings.

System.String name

The name of the module.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

FormatVersion(Version, Boolean)

Formats the version.

Declaration
public static string FormatVersion(Version version, bool includeBuild)
Parameters
Type Name Description
Version version

The version.

System.Boolean includeBuild

if set to true [include build].

Returns
Type Description
System.String

Formatted version as string.

Examples
var version = new Version(6, 0, 0, 147);
string formattedVersion = FormatVersion(version, true); // formattedVersion's value will be: 06.00.00(147)
| Improve this Doc View Source

FormatVersion(Version, String, Int32, String)

Formats a version into the standard format nn.nn.nn.

Declaration
public static string FormatVersion(Version version, string fieldFormat, int fieldCount, string delimiterCharacter)
Parameters
Type Name Description
Version version

The version to be formatted.

System.String fieldFormat

The field format.

System.Int32 fieldCount

The field count.

System.String delimiterCharacter

The delimiter character.

Returns
Type Description
System.String

Formatted version as a string.

| Improve this Doc View Source

FormatVersion(Version)

Formats the system.version into the standard format nn.nn.nn.

Declaration
public static string FormatVersion(Version version)
Parameters
Type Name Description
Version version

The version.

Returns
Type Description
System.String

Formatted version as string.

| Improve this Doc View Source

FormatWebsite(Object)

Formats a domain name including link.

Declaration
public static string FormatWebsite(object website)
Parameters
Type Name Description
System.Object website

The domain name to format.

Returns
Type Description
System.String

The formatted domain name.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, IPortalSettings)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings settings)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

IPortalSettings settings

The portal settings.

Returns
Type Description
System.String

The formatted (friendly) URL.

Remarks

This overload includes the portal settings for the site.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, PortalSettings)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, PortalSettings settings)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

PortalSettings settings

The portal settings.

Returns
Type Description
System.String

The formatted (friendly) URL.

Remarks

This overload includes the portal settings for the site.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, String, IPortalSettings)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

System.String pageName

The page to include in the URL.

IPortalSettings settings

The portal settings.

Returns
Type Description
System.String

The formatted (friendly) url.

Remarks

This overload includes an optional page to include in the URL, and the portal settings for the site.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, String, PortalSettings)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

System.String pageName

The page to include in the URL.

PortalSettings settings

The portal settings.

Returns
Type Description
System.String

The formatted (friendly) url.

Remarks

This overload includes an optional page to include in the URL, and the portal settings for the site.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, String, String)

Generates the correctly formatted friendly url.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

System.String pageName

The page to include in the URL.

System.String portalAlias

The portal alias for the site.

Returns
Type Description
System.String

The formatted (friendly) URL.

Remarks

This overload includes an optional page to include in the url, and the portal alias for the site.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String, String)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path, string pageName)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

System.String pageName

The page to include in the url.

Returns
Type Description
System.String

The formatted (friendly) URL.

Remarks

This overload includes an optional page to include in the url.

| Improve this Doc View Source

FriendlyUrl(TabInfo, String)

Generates the correctly formatted friendly URL.

Declaration
public static string FriendlyUrl(TabInfo tab, string path)
Parameters
Type Name Description
TabInfo tab

The current tab.

System.String path

The path to format.

Returns
Type Description
System.String

The formatted (friendly) URL.

Remarks

Assumes Default.aspx, and that portalsettings are saved to Context.

| Improve this Doc View Source

GenerateTabPath(Int32, String)

GenerateTabPath generates the TabPath used in Friendly URLS.

Declaration
public static string GenerateTabPath(int parentId, string tabName)
Parameters
Type Name Description
System.Int32 parentId

The Id of the Parent Tab.

System.String tabName

The Name of the current Tab.

Returns
Type Description
System.String

The TabPath.

| Improve this Doc View Source

GetAbsoluteServerPath(HttpRequest)

Gets the absolute server path.

Declaration
public static string GetAbsoluteServerPath(HttpRequest request)
Parameters
Type Name Description
HttpRequest request

The request.

Returns
Type Description
System.String

absolute server path.

| Improve this Doc View Source

GetApplicationName()

Gets the ApplicationName for the MemberRole API.

Declaration
public static string GetApplicationName()
Returns
Type Description
System.String

A string representing the application name.

Remarks

This overload is used to get the current ApplcationName. The Application Name is in the form Prefix_Id, where Prefix is the object qualifier for this instance of DotNetNuke, and Id is the current PortalId for normal users or glbSuperUserAppName for SuperUsers.

| Improve this Doc View Source

GetApplicationName(Int32)

Gets the ApplicationName for the MemberRole API.

Declaration
public static string GetApplicationName(int portalID)
Parameters
Type Name Description
System.Int32 portalID

The id of the portal (site).

Returns
Type Description
System.String

A string representing the application name.

Remarks

This overload is used to build the Application Name from the Portal Id.

| Improve this Doc View Source

GetContent(String, String)

Gets the content.

Declaration
public static XmlNode GetContent(string content, string contentType)
Parameters
Type Name Description
System.String content

The content.

System.String contentType

Type of the content.

Returns
Type Description
XmlNode

specific node by content type of the whole document.

| Improve this Doc View Source

GetDBConnectionString()

Gets the database connection string.

Declaration
public static string GetDBConnectionString()
Returns
Type Description
System.String

The database connection string.

| Improve this Doc View Source

GetDomainName(HttpRequest, Boolean)

returns the domain name of the current request ( ie. www.domain.com or 207.132.12.123 or www.domain.com/directory if subhost ).

Declaration
public static string GetDomainName(HttpRequest request, bool parsePortNumber)
Parameters
Type Name Description
HttpRequest request

The request.

System.Boolean parsePortNumber

if set to true [parse port number].

Returns
Type Description
System.String

domain name.

| Improve this Doc View Source

GetDomainName(HttpRequest)

Gets the name of the domain.

Declaration
public static string GetDomainName(HttpRequest request)
Parameters
Type Name Description
HttpRequest request

The request.

Returns
Type Description
System.String

domain name.

| Improve this Doc View Source

GetDomainName(HttpRequestBase, Boolean)

returns the domain name of the current request ( ie. www.domain.com or 207.132.12.123 or www.domain.com/directory if subhost ).

Declaration
public static string GetDomainName(HttpRequestBase request, bool parsePortNumber)
Parameters
Type Name Description
HttpRequestBase request

The request.

System.Boolean parsePortNumber

if set to true [parse port number].

Returns
Type Description
System.String

domain name.

| Improve this Doc View Source

GetDomainName(HttpRequestBase)

Gets the name of the domain.

Declaration
public static string GetDomainName(HttpRequestBase request)
Parameters
Type Name Description
HttpRequestBase request

The request.

Returns
Type Description
System.String

domain name.

| Improve this Doc View Source

GetExternalRequest(String, NetworkCredential)

Gets the external request.

Declaration
public static HttpWebRequest GetExternalRequest(string address, NetworkCredential credentials)
Parameters
Type Name Description
System.String address

The address.

NetworkCredential credentials

The credentials.

Returns
Type Description
HttpWebRequest

Web request.

| Improve this Doc View Source

GetExternalRequest(String)

Gets the external request.

Declaration
public static HttpWebRequest GetExternalRequest(string address)
Parameters
Type Name Description
System.String address

The address.

Returns
Type Description
HttpWebRequest

Web request.

| Improve this Doc View Source

GetFileList()

Gets the file list.

Declaration
public static ArrayList GetFileList()
Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetFileList(DirectoryInfo, String, Boolean)

Gets a file list.

Declaration
public static ArrayList GetFileList(DirectoryInfo currentDirectory, string strExtensions, bool noneSpecified)
Parameters
Type Name Description
DirectoryInfo currentDirectory

The current directory.

System.String strExtensions

The extensions to filter for.

System.Boolean noneSpecified

If true, adds 'None Specified' to the list.

Returns
Type Description
ArrayList

A list of file names.

| Improve this Doc View Source

GetFileList(Int32, String, Boolean, String, Boolean)

Gets the file list.

Declaration
public static ArrayList GetFileList(int portalId, string strExtensions, bool noneSpecified, string folder, bool includeHidden)
Parameters
Type Name Description
System.Int32 portalId

The portal id.

System.String strExtensions

The STR extensions.

System.Boolean noneSpecified

if set to true [none specified].

System.String folder

The folder.

System.Boolean includeHidden

if set to true [include hidden].

Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetFileList(Int32, String, Boolean, String)

Gets the file list.

Declaration
public static ArrayList GetFileList(int portalId, string strExtensions, bool noneSpecified, string folder)
Parameters
Type Name Description
System.Int32 portalId

The portal id.

System.String strExtensions

The STR extensions.

System.Boolean noneSpecified

if set to true [none specified].

System.String folder

The folder.

Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetFileList(Int32, String, Boolean)

Gets the file list.

Declaration
public static ArrayList GetFileList(int portalId, string strExtensions, bool noneSpecified)
Parameters
Type Name Description
System.Int32 portalId

The portal id.

System.String strExtensions

The STR extensions.

System.Boolean noneSpecified

if set to true [none specified].

Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetFileList(Int32, String)

Gets the file list.

Declaration
public static ArrayList GetFileList(int portalId, string strExtensions)
Parameters
Type Name Description
System.Int32 portalId

The portal id.

System.String strExtensions

The STR extensions.

Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetFileList(Int32)

Gets the file list.

Declaration
public static ArrayList GetFileList(int portalId)
Parameters
Type Name Description
System.Int32 portalId

The portal id.

Returns
Type Description
ArrayList

file list.

| Improve this Doc View Source

GetHashValue(Object, String)

Gets the hash value.

Declaration
public static string GetHashValue(object hashObject, string defaultValue)
Parameters
Type Name Description
System.Object hashObject

The hash object.

System.String defaultValue

The default value.

Returns
Type Description
System.String

HashOject's value or DefaultValue if HashObject is null.

| Improve this Doc View Source

GetHelpText(Int32)

Gets the help text.

Declaration
public static string GetHelpText(int moduleControlId)
Parameters
Type Name Description
System.Int32 moduleControlId

The module control id.

Returns
Type Description
System.String

help text.

| Improve this Doc View Source

GetHostPortalSettings()

Gets the host portal settings.

Declaration
public static PortalSettings GetHostPortalSettings()
Returns
Type Description
PortalSettings

Host portal settings.

| Improve this Doc View Source

GetLastAppliedIteration(Version)

Gets the last applied iteration (revision).

Declaration
public static int GetLastAppliedIteration(Version version)
Parameters
Type Name Description
Version version

The version for which to check the last revision.

Returns
Type Description
System.Int32

The last applied iteration (revision) for the requested version.

| Improve this Doc View Source

GetMediumDate(String)

Gets the medium date by current culture.

Declaration
public static string GetMediumDate(string strDate)
Parameters
Type Name Description
System.String strDate

The date.

Returns
Type Description
System.String

return formatted content of the date if paramter isn't empty, else return the parameter.

Examples
var mediumDate = GetMediumDate("6/1/2011");
| Improve this Doc View Source

GetOnLineHelp(String, ModuleInfo)

Gets the online help url or the host configured help url if no url provided.

Declaration
public static string GetOnLineHelp(string helpUrl, ModuleInfo moduleConfig)
Parameters
Type Name Description
System.String helpUrl

The help URL.

ModuleInfo moduleConfig

The module config.

Returns
Type Description
System.String

The help url.

| Improve this Doc View Source

GetOnLineHelp(String)

Gets the online help url or the host configured help url if no url provided.

Declaration
public static string GetOnLineHelp(string helpUrl)
Parameters
Type Name Description
System.String helpUrl

The help URL.

Returns
Type Description
System.String

The help url.

| Improve this Doc View Source

GetPortalDomainName(String, HttpRequest, Boolean)

Gets the portal domain name.

Declaration
public static string GetPortalDomainName(string strPortalAlias, HttpRequest request, bool blnAddHTTP)
Parameters
Type Name Description
System.String strPortalAlias

The portal alias.

HttpRequest request

The request or null.

System.Boolean blnAddHTTP

if set to true calls AddHTTP(String) on the result.

Returns
Type Description
System.String

domain name.

| Improve this Doc View Source

GetPortalSettings()

Gets the portal settings.

Declaration
public static PortalSettings GetPortalSettings()
Returns
Type Description
PortalSettings

Portal settings.

| Improve this Doc View Source

GetRoleName(Int32)

Gets the name of the role.

Declaration
public static string GetRoleName(int roleId)
Parameters
Type Name Description
System.Int32 roleId

The role ID.

Returns
Type Description
System.String

Role Name.

| Improve this Doc View Source

GetShortDate(String)

Gets the short date.

Declaration
public static string GetShortDate(string strDate)
Parameters
Type Name Description
System.String strDate

The date.

Returns
Type Description
System.String

short date content of the input.

| Improve this Doc View Source

GetSubFolderPath(String, Int32)

Returns the folder path under the root for the portal.

Declaration
public static string GetSubFolderPath(string strFileNamePath, int portalId)
Parameters
Type Name Description
System.String strFileNamePath

The folder the absolute path.

System.Int32 portalId

Portal Id.

Returns
Type Description
System.String

A string containing the subfolder path.

| Improve this Doc View Source

GetSubFolderPath(String)

Gets the subfolder path for a give filename path.

Declaration
public static string GetSubFolderPath(string strFileNamePath)
Parameters
Type Name Description
System.String strFileNamePath

The filename full path.

Returns
Type Description
System.String

The subfolder name.

| Improve this Doc View Source

GetTotalRecords(ref IDataReader)

The GetTotalRecords method gets the number of Records returned.

Declaration
public static int GetTotalRecords(ref IDataReader dr)
Parameters
Type Name Description
IDataReader dr

An containing the Total number of records.

Returns
Type Description
System.Int32

The total number of records in the data reader.

| Improve this Doc View Source

GetURLType(String)

Returns the type of URl (T=other tab, F=file, U=URL, N=normal).

Declaration
public static TabType GetURLType(string url)
Parameters
Type Name Description
System.String url

The url.

Returns
Type Description
TabType

The url type.

| Improve this Doc View Source

HTTPPOSTEncode(String)

Encode the post url.

Declaration
public static string HTTPPOSTEncode(string strPost)
Parameters
Type Name Description
System.String strPost

The post url.

Returns
Type Description
System.String

encoded value.

| Improve this Doc View Source

ImportFile(Int32, String)

ImportFile - converts a file url (/Portals/0/somefile.gif) to the appropriate FileID=xx identification for use in importing portals, tabs and modules.

Declaration
public static string ImportFile(int portalId, string url)
Parameters
Type Name Description
System.Int32 portalId

The id of the portal (site) on which the file is imported.

System.String url

The url to the file.

Returns
Type Description
System.String

The file handler url for the file (FileID=xxxx).

| Improve this Doc View Source

ImportUrl(Int32, String)

Url's as internal links to Files, Tabs and Users should only be imported if those files, tabs and users exist. This function parses the url, and checks whether the internal links exist. If the link does not exist, the function will return an empty string.

Declaration
public static string ImportUrl(int moduleId, string url)
Parameters
Type Name Description
System.Int32 moduleId

The id of the module (unused).

System.String url

the url to import.

Returns
Type Description
System.String

If an internal link does not exist, an empty string is returned, otherwise the passed in url is returned as is.

| Improve this Doc View Source

ImportUrl(String)

Url's as internal links to Files, Tabs and Users should only be imported if those files, tabs and users exist. This function parses the url, and checks whether the internal links exist. If the link does not exist, the function will return an empty string.

Declaration
public static string ImportUrl(string url)
Parameters
Type Name Description
System.String url

The url to import.

Returns
Type Description
System.String

If an internal link does not exist, an empty string is returned, otherwise the passed in url is returned as is.

| Improve this Doc View Source

IncrementalVersionExists(Version)

Checks if incremental sqlDataProvider files exist.

Declaration
public static bool IncrementalVersionExists(Version version)
Parameters
Type Name Description
Version version

The version.

Returns
Type Description
System.Boolean

A value indicating whether any incremental sql script file exists.

Examples

If a 09.08.01.01.sqlDataProvider file exists for a provided version 09.08.01 this method will return true.

| Improve this Doc View Source

IsAdminControl()

Determines whether current request contains admin control information.

Declaration
public static bool IsAdminControl()
Returns
Type Description
System.Boolean

true if current request contains admin control information; otherwise, false.

| Improve this Doc View Source

IsAdminSkin()

Determines whether current request use admin skin.

Declaration
public static bool IsAdminSkin()
Returns
Type Description
System.Boolean

true if current request use admin skin; otherwise, false.

| Improve this Doc View Source

IsEditMode()

Returns whether the current tab is in EditMode.

Declaration
public static bool IsEditMode()
Returns
Type Description
System.Boolean

true if the tab is in Edit mode; otherwise false.

| Improve this Doc View Source

IsHostTab(Int32)

Check whether the specific page is a host page.

Declaration
public static bool IsHostTab(int tabId)
Parameters
Type Name Description
System.Int32 tabId

The tab ID.

Returns
Type Description
System.Boolean

if true the tab is a host page; otherwise, it is not a host page.

| Improve this Doc View Source

IsLayoutMode()

Returns whether the current tab is in LayoutMode.

Declaration
public static bool IsLayoutMode()
Returns
Type Description
System.Boolean

true if the current tab is in layout mode; otherwise false.

| Improve this Doc View Source

LinkClick(String, Int32, Int32, Boolean, Boolean, Int32, Boolean, String)

Gets Link click url.

Declaration
public static string LinkClick(string link, int tabId, int moduleId, bool trackClicks, bool forceDownload, int portalId, bool enableUrlLanguage, string portalGuid)
Parameters
Type Name Description
System.String link

The link.

System.Int32 tabId

The tab ID.

System.Int32 moduleId

The module ID.

System.Boolean trackClicks

if set to true [track clicks].

System.Boolean forceDownload

if set to true [force download].

System.Int32 portalId

The portal id.

System.Boolean enableUrlLanguage

if set to true [enable URL language].

System.String portalGuid

The portal GUID.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

LinkClick(String, Int32, Int32, Boolean, Boolean)

Gets Link click url.

Declaration
public static string LinkClick(string link, int tabId, int moduleId, bool trackClicks, bool forceDownload)
Parameters
Type Name Description
System.String link

The link.

System.Int32 tabId

The tab ID.

System.Int32 moduleId

The module ID.

System.Boolean trackClicks

if set to true [track clicks].

System.Boolean forceDownload

if set to true [force download].

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

LinkClick(String, Int32, Int32, Boolean, String)

Gets Link click url.

Declaration
public static string LinkClick(string link, int tabId, int moduleId, bool trackClicks, string contentType)
Parameters
Type Name Description
System.String link

The link.

System.Int32 tabId

The tab ID.

System.Int32 moduleId

The module ID.

System.Boolean trackClicks

if set to true [track clicks].

System.String contentType

Type of the content.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

LinkClick(String, Int32, Int32, Boolean)

Gets Link click url.

Declaration
public static string LinkClick(string link, int tabId, int moduleId, bool trackClicks)
Parameters
Type Name Description
System.String link

The link.

System.Int32 tabId

The tab ID.

System.Int32 moduleId

The module ID.

System.Boolean trackClicks

if set to true [track clicks].

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

LinkClick(String, Int32, Int32)

Gets Link click url.

Declaration
public static string LinkClick(string link, int tabId, int moduleId)
Parameters
Type Name Description
System.String link

The link.

System.Int32 tabId

The tab ID.

System.Int32 moduleId

The module ID.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

LinkClickURL(String)

Gets a LinkClick url for tracking purposes.

Declaration
public static string LinkClickURL(string link)
Parameters
Type Name Description
System.String link

The actual link the LinkClick handler should point to.

Returns
Type Description
System.String

The formatted LinkClick url.

| Improve this Doc View Source

LoginURL(String, Boolean, IPortalSettings)

Gets the login URL.

Declaration
public static string LoginURL(string returnUrl, bool overrideSetting, IPortalSettings portalSettings)
Parameters
Type Name Description
System.String returnUrl

The URL to redirect to after logging in.

System.Boolean overrideSetting

if set to true, show the login control on the current page, even if there is a login page defined for the site.

IPortalSettings portalSettings

The Portal Settings.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

LoginURL(String, Boolean, PortalSettings)

Gets the login URL.

Declaration
public static string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings)
Parameters
Type Name Description
System.String returnUrl

The URL to redirect to after logging in.

System.Boolean overrideSetting

if set to true, show the login control on the current page, even if there is a login page defined for the site.

PortalSettings portalSettings

The Portal Settings.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

LoginURL(String, Boolean)

Gets the login URL.

Declaration
public static string LoginURL(string returnUrl, bool overrideSetting)
Parameters
Type Name Description
System.String returnUrl

The URL to redirect to after logging in.

System.Boolean overrideSetting

if set to true, show the login control on the current page, even if there is a login page defined for the site.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

ManageTokenUploadDirectory(String, String, String)

Injects the upload directory into raw HTML for a single token.

Declaration
public static string ManageTokenUploadDirectory(string strHTML, string strUploadDirectory, string strToken)
Parameters
Type Name Description
System.String strHTML

The raw HTML text.

System.String strUploadDirectory

The path of portal image directory.

System.String strToken

The token to be replaced.

Returns
Type Description
System.String

HTML with paths for images and background corrected.

Remarks

Called by ManageUploadDirectory for each token.

| Improve this Doc View Source

ManageUploadDirectory(String, String)

injects the upload directory into raw HTML for src and background tags.

Declaration
public static string ManageUploadDirectory(string strHTML, string strUploadDirectory)
Parameters
Type Name Description
System.String strHTML

raw HTML text.

System.String strUploadDirectory

path of portal image directory.

Returns
Type Description
System.String

HTML with paths for images and background corrected.

| Improve this Doc View Source

NavigateURL()

Gets the URL to the current page.

Declaration
public static string NavigateURL()
Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, PortalSettings, String, String[])

Gets the URL to show the given page.

Declaration
public static string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

PortalSettings settings

The portal settings.

System.String controlKey

The control key, or or null.

System.String[] additionalParameters

Any additional parameters.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, Boolean, PortalSettings, String, String, String, String[])

Gets the URL to show the given page.

Declaration
public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.Boolean isSuperTab

if set to true the page is a "super-tab," i.e. a host-level page.

PortalSettings settings

The portal settings.

System.String controlKey

The control key, or or null.

System.String language

The language code.

System.String pageName

The page name to pass to FriendlyUrl(TabInfo, String, String).

System.String[] additionalParameters

Any additional parameters.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

NavigateURL(Int32, Boolean, PortalSettings, String, String, String[])

Gets the URL to show the given page.

Declaration
public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.Boolean isSuperTab

if set to true the page is a "super-tab," i.e. a host-level page.

PortalSettings settings

The portal settings.

System.String controlKey

The control key, or or null.

System.String language

The language code.

System.String[] additionalParameters

Any additional parameters.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, Boolean, PortalSettings, String, String[])

Gets the URL to show the given page.

Declaration
public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.Boolean isSuperTab

if set to true the page is a "super-tab," i.e. a host-level page.

PortalSettings settings

The portal settings.

System.String controlKey

The control key, or or null.

System.String[] additionalParameters

Any additional parameters.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, Boolean)

Gets the URL to the given page.

Declaration
public static string NavigateURL(int tabID, bool isSuperTab)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.Boolean isSuperTab

if set to true the page is a "super-tab," i.e. a host-level page.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, String, String[])

Gets the URL to show the given page.

Declaration
public static string NavigateURL(int tabID, string controlKey, params string[] additionalParameters)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.String controlKey

The control key, or or null.

System.String[] additionalParameters

Any additional parameters.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32, String)

Gets the URL to show the control associated with the given control key on the given page.

Declaration
public static string NavigateURL(int tabID, string controlKey)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

System.String controlKey

The control key, or or null.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(Int32)

Gets the URL to the given page.

Declaration
public static string NavigateURL(int tabID)
Parameters
Type Name Description
System.Int32 tabID

The tab ID.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(String, String[])

Gets the URL to show the control associated with the given control key.

Declaration
public static string NavigateURL(string controlKey, params string[] additionalParameters)
Parameters
Type Name Description
System.String controlKey

The control key, or or null.

System.String[] additionalParameters

Any additional parameters, in "key=value" format.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

NavigateURL(String)

Gets the URL to show the control associated with the given control key.

Declaration
public static string NavigateURL(string controlKey)
Parameters
Type Name Description
System.String controlKey

The control key, or or null.

Returns
Type Description
System.String

Formatted URL.

| Improve this Doc View Source

PreventSQLInjection(String)

Helps prevent sql injection in certain scenarios.

Declaration
public static string PreventSQLInjection(string strSQL)
Parameters
Type Name Description
System.String strSQL

The string to filter.

Returns
Type Description
System.String

The filtered string.

Remarks

IMPORTANT: It is highly recommended to use other forms of sql injection protection such as using SqlParameters or ORMs.

| Improve this Doc View Source

QueryStringDecode(String)

UrlDecode query string.

Declaration
public static string QueryStringDecode(string queryString)
Parameters
Type Name Description
System.String queryString

The query string.

Returns
Type Description
System.String

Decoded content.

| Improve this Doc View Source

QueryStringEncode(String)

UrlEncode query string.

Declaration
public static string QueryStringEncode(string queryString)
Parameters
Type Name Description
System.String queryString

The query string.

Returns
Type Description
System.String

Encoded content.

| Improve this Doc View Source

Redirect(String, Boolean)

Redirects the specified URL.

Declaration
public static void Redirect(string url, bool endResponse)
Parameters
Type Name Description
System.String url

The URL.

System.Boolean endResponse

if set to true [end response].

| Improve this Doc View Source

RegisterURL(String, String)

Gets Register URL.

Declaration
public static string RegisterURL(string returnURL, string originalURL)
Parameters
Type Name Description
System.String returnURL

The return URL.

System.String originalURL

The original URL.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

ResolveUrl(String)

Generates the correctly formatted url.

Declaration
public static string ResolveUrl(string url)
Parameters
Type Name Description
System.String url

The url to format.

Returns
Type Description
System.String

The formatted (resolved) url.

| Improve this Doc View Source

SerializeHashTableBase64(Hashtable)

SerializeHashTableBase64 serializes a Hashtable using Binary Formatting.

Declaration
public static string SerializeHashTableBase64(Hashtable source)
Parameters
Type Name Description
Hashtable source

The Hashtable to serialize.

Returns
Type Description
System.String

The serialized String.

Remarks

While this method of serializing is no longer supported (due to Medium Trust issue, it is still required for upgrade purposes.

| Improve this Doc View Source

SerializeHashTableXml(Hashtable)

SerializeHashTableXml serializes a Hashtable using Xml Serialization.

Declaration
public static string SerializeHashTableXml(Hashtable source)
Parameters
Type Name Description
Hashtable source

The Hashtable to serialize.

Returns
Type Description
System.String

The serialized String.

Remarks

This is the preferred method of serialization under Medium Trust.

| Improve this Doc View Source

SetApplicationName(Int32)

Sets the ApplicationName for the MemberRole API.

Declaration
public static void SetApplicationName(int portalId)
Parameters
Type Name Description
System.Int32 portalId

The Portal ID.

Remarks

This overload takes a the PortalId.

| Improve this Doc View Source

SetApplicationName(String)

Sets the ApplicationName for the MemberRole API.

Declaration
public static void SetApplicationName(string applicationName)
Parameters
Type Name Description
System.String applicationName

The Application Name to set.

Remarks

This overload takes a the PortalId.

| Improve this Doc View Source

SetFormFocus(Control)

Sets the form focus.

Declaration
public static void SetFormFocus(Control control)
Parameters
Type Name Description
Control control

The control.

| Improve this Doc View Source

SetStatus(Globals.UpgradeStatus)

Sets the status.

Declaration
public static void SetStatus(Globals.UpgradeStatus status)
Parameters
Type Name Description
Globals.UpgradeStatus status

The status.

| Improve this Doc View Source

UpdateDataBaseVersion(Version)

Updates the database version.

Declaration
public static void UpdateDataBaseVersion(Version version)
Parameters
Type Name Description
Version version

The version.

| Improve this Doc View Source

UpdateDataBaseVersionIncrement(Version, Int32)

Updates the database version.

Declaration
public static void UpdateDataBaseVersionIncrement(Version version, int increment)
Parameters
Type Name Description
Version version

The version.

System.Int32 increment

The increment (revision) number.

| Improve this Doc View Source

UsePortNumber()

Determin whether use port number by the value in config file.

Declaration
public static bool UsePortNumber()
Returns
Type Description
System.Boolean

true if use port number, otherwise, return false.

| Improve this Doc View Source

UserProfilePicFormattedUrl()

Return User Profile Picture Formatted Url. UserId, width and height can be passed to build a formatted Avatar Url.

Declaration
public static string UserProfilePicFormattedUrl()
Returns
Type Description
System.String

Formatted url, e.g. http://www.mysite.com/DnnImageHandler.ashx?mode=profilepic&userid={0}&h={1}&w={2}.

Remarks

Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> code behind - avatar.ImageUrl = string.Format(Globals.UserProfilePicFormattedUrl(), userInfo.UserID, 32, 32).

| Improve this Doc View Source

UserProfilePicRelativeUrl()

Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url.

Declaration
public static string UserProfilePicRelativeUrl()
Returns
Type Description
System.String

Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal.

Remarks

Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> code behind - avatar.ImageUrl = string.Format(Globals.UserProfilePicRelativeUrl(), userInfo.UserID, 32, 32).

| Improve this Doc View Source

UserProfilePicRelativeUrl(Boolean)

Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url.

Declaration
public static string UserProfilePicRelativeUrl(bool includeCdv)
Parameters
Type Name Description
System.Boolean includeCdv

Indicates if cdv (Cache Delayed Verification) has to be included in the returned URL.

Returns
Type Description
System.String

Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal.

Remarks

Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> code behind - avatar.ImageUrl = string.Format(Globals.UserProfilePicRelativeUrl(), userInfo.UserID, 32, 32).

| Improve this Doc View Source

UserProfileURL(Int32)

Gets User profile URL.

Declaration
public static string UserProfileURL(int userId)
Parameters
Type Name Description
System.Int32 userId

The user id.

Returns
Type Description
System.String

Formatted url.

| Improve this Doc View Source

ValidateLoginTabID(Int32)

Check whether the tab contains "Account Login" module.

Declaration
public static bool ValidateLoginTabID(int tabId)
Parameters
Type Name Description
System.Int32 tabId

The tab id.

Returns
Type Description
System.Boolean

true if the tab contains "Account Login" module, otherwise, false.

| Improve this Doc View Source

ValidateModuleInTab(Int32, String)

Check whether the tab contains specific module.

Declaration
public static bool ValidateModuleInTab(int tabId, string moduleName)
Parameters
Type Name Description
System.Int32 tabId

The tab id.

System.String moduleName

The module need to check.

Returns
Type Description
System.Boolean

true if the tab contains the module, otherwise, false.

| Improve this Doc View Source

XMLEncode(String)

Xml encodes an html string.

Declaration
public static string XMLEncode(string html)
Parameters
Type Name Description
System.String html

The html to encode.

Returns
Type Description
System.String

The encoded html for usage in xml.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS