Class Globals
The global instance of DotNetNuke. all basic functions and properties are defined in this instance.
Inheritance
Namespace: DotNetNuke.Common
Assembly: DotNetNuke.dll
Syntax
public sealed class Globals : object
Fields
| Improve this Doc View SourceBaseTagRegex
Validates if a tag is an html 'base' tag.
Declaration
public static readonly Regex BaseTagRegex
Field Value
Type | Description |
---|---|
Regex |
EmailValidatorRegex
Validates for a valid email address.
Declaration
public static readonly Regex EmailValidatorRegex
Field Value
Type | Description |
---|---|
Regex |
FileEscapingRegex
Finds common file escaping characters.
Declaration
public static readonly Regex FileEscapingRegex
Field Value
Type | Description |
---|---|
Regex |
FileExtensionRegex
Checks if a string is a valid Windows file extension.
Declaration
public static readonly Regex FileExtensionRegex
Field Value
Type | Description |
---|---|
Regex |
FileValidNameRegex
Checks if a string is a valid Windows filename.
Declaration
public static readonly Regex FileValidNameRegex
Field Value
Type | Description |
---|---|
Regex |
glbAboutPage
About page name.
Declaration
public const string glbAboutPage = null
Field Value
Type | Description |
---|---|
System.String | about.htm. |
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. |
glbConfigFolder
Config files folder.
Declaration
public const string glbConfigFolder = null
Field Value
Type | Description |
---|---|
System.String | \Config. |
glbContainersPath
Default container folder.
Declaration
public const string glbContainersPath = null
Field Value
Type | Description |
---|---|
System.String | Portals/_default/Containers/. |
glbDefaultControlPanel
Default control panel.
Declaration
public const string glbDefaultControlPanel = null
Field Value
Type | Description |
---|---|
System.String | Admin/ControlPanel/IconBar.ascx. |
glbDefaultPage
Default page name.
Declaration
public const string glbDefaultPage = null
Field Value
Type | Description |
---|---|
System.String | Default.aspx. |
glbDefaultPane
Default pane name.
Declaration
public const string glbDefaultPane = null
Field Value
Type | Description |
---|---|
System.String | ContentPane. |
glbDotNetNukeConfig
DotNetNuke config file.
Declaration
public const string glbDotNetNukeConfig = null
Field Value
Type | Description |
---|---|
System.String | DotNetNuke.config. |
glbEmailRegEx
Email address regex pattern.
Declaration
public const string glbEmailRegEx = null
Field Value
Type | Description |
---|---|
System.String | ^[a-zA-Z0-9_%+#&'/=^ |
glbHostSkinFolder
Default host skin folder.
Declaration
public const string glbHostSkinFolder = null
Field Value
Type | Description |
---|---|
System.String | _default. |
glbProtectedExtension
extension of protected files.
Declaration
public const string glbProtectedExtension = null
Field Value
Type | Description |
---|---|
System.String | .resources. |
glbRoleAllUsers
Global role id for all users.
Declaration
public const string glbRoleAllUsers = null
Field Value
Type | Description |
---|---|
System.String | -1. |
glbRoleAllUsersName
Global role name for all users.
Declaration
public const string glbRoleAllUsersName = null
Field Value
Type | Description |
---|---|
System.String | All Users. |
glbRoleNothing
Global role id by default.
Declaration
public const string glbRoleNothing = null
Field Value
Type | Description |
---|---|
System.String | -4. |
glbRoleSuperUser
Global role id for super user.
Declaration
public const string glbRoleSuperUser = null
Field Value
Type | Description |
---|---|
System.String | -2. |
glbRoleSuperUserName
Global ro name for super user.
Declaration
public const string glbRoleSuperUserName = null
Field Value
Type | Description |
---|---|
System.String | Superuser. |
glbRoleUnauthUser
Global role id for unauthenticated users.
Declaration
public const string glbRoleUnauthUser = null
Field Value
Type | Description |
---|---|
System.String | -3. |
glbRoleUnauthUserName
Global role name for unauthenticated users.
Declaration
public const string glbRoleUnauthUserName = null
Field Value
Type | Description |
---|---|
System.String | Unauthenticated Users. |
glbScriptFormat
Format of a script tag.
Declaration
public const string glbScriptFormat = null
Field Value
Type | Description |
---|---|
System.String | <script type="text/javascript" src="{0}" ></script> |
glbSkinsPath
Default skin folder.
Declaration
public const string glbSkinsPath = null
Field Value
Type | Description |
---|---|
System.String | Portals/_default/Skins/. |
glbSuperUserAppName
Default portal id for super user.
Declaration
public const int glbSuperUserAppName = null
Field Value
Type | Description |
---|---|
System.Int32 | -1. |
glbUserNameMinLength
User Name default minimum length.
Declaration
public const int glbUserNameMinLength = null
Field Value
Type | Description |
---|---|
System.Int32 |
glbUserNameRegEx
User Name regex pattern.
Declaration
public const string glbUserNameRegEx = null
Field Value
Type | Description |
---|---|
System.String |
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 |
InvalidInitialCharacters
Validates if the first character is a letter.
Declaration
public static readonly Regex InvalidInitialCharacters
Field Value
Type | Description |
---|---|
Regex |
NonAlphanumericCharacters
Finds non-alphanumeric characters.
Declaration
public static readonly Regex NonAlphanumericCharacters
Field Value
Type | Description |
---|---|
Regex |
NumberMatchRegex
Validates if the string contains only numbers.
Declaration
public static readonly Regex NumberMatchRegex
Field Value
Type | Description |
---|---|
Regex |
ServicesFrameworkRegex
Checks if a url part is a valid services framework url.
Declaration
public static readonly Regex ServicesFrameworkRegex
Field Value
Type | Description |
---|---|
Regex |
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 SourceApplicationMapPath
Gets the application map path.
Declaration
public static string ApplicationMapPath { get; }
Property Value
Type | Description |
---|---|
System.String | The application map path. |
ApplicationPath
Gets the application path.
Declaration
public static string ApplicationPath { get; }
Property Value
Type | Description |
---|---|
System.String |
DatabaseEngineVersion
Gets or sets the database engine version.
Declaration
public static Version DatabaseEngineVersion { get; set; }
Property Value
Type | Description |
---|---|
Version | The database engine version. |
DataBaseVersion
Gets the database version.
Declaration
public static Version DataBaseVersion { get; }
Property Value
Type | Description |
---|---|
Version |
DesktopModulePath
Gets the desktop module path.
Declaration
public static string DesktopModulePath { get; }
Property Value
Type | Description |
---|---|
System.String | ApplicationPath + "/DesktopModules/". |
ElapsedSinceAppStart
Gets a value indicating for how long the application has been running.
Declaration
public static TimeSpan ElapsedSinceAppStart { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
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. |
HostMapPath
Gets the host map path.
Declaration
public static string HostMapPath { get; }
Property Value
Type | Description |
---|---|
System.String | ApplicationMapPath + "Portals_default". |
HostPath
Gets the host path.
Declaration
public static string HostPath { get; }
Property Value
Type | Description |
---|---|
System.String | ApplicationPath + "/Portals/_default/". |
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"]. |
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. |
ImagePath
Gets the image path.
Declaration
public static string ImagePath { get; }
Property Value
Type | Description |
---|---|
System.String | ApplicationPath + "/Images/". |
InstallMapPath
Gets the install map path.
Declaration
public static string InstallMapPath { get; }
Property Value
Type | Description |
---|---|
System.String | server map path of InstallPath. |
InstallPath
Gets the install path.
Declaration
public static string InstallPath { get; }
Property Value
Type | Description |
---|---|
System.String | ApplicationPath + "/Install/". |
NETFrameworkVersion
Gets or sets the NET framework version.
Declaration
public static Version NETFrameworkVersion { get; set; }
Property Value
Type | Description |
---|---|
Version | The NET framework version. |
OperatingSystemVersion
Gets or sets the operating system version.
Declaration
public static Version OperatingSystemVersion { get; set; }
Property Value
Type | Description |
---|---|
Version | The operating system version. |
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. |
Status
Gets the status of application.
Declaration
public static Globals.UpgradeStatus Status { get; }
Property Value
Type | Description |
---|---|
Globals.UpgradeStatus |
Methods
| Improve this Doc View SourceAccessDeniedURL()
Get the URL to show the "access denied" message.
Declaration
public static string AccessDeniedURL()
Returns
Type | Description |
---|---|
System.String | URL to access denied view. |
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. |
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. |
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. |
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.
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.
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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
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. |
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. |
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. |
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. |
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. |
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.
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.
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. |
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. |
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.
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 |
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. |
FormatEmail(String)
Formats an email address as a cloacked html link.
Declaration
public static string FormatEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | The formatted email address. |
Returns
Type | Description |
---|---|
System.String | A cloacked html link. |
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. |
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. |
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 |
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. |
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. |
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. |
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.
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.
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.
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.
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.
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.
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.
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. |
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. |
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.
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.
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. |
GetDBConnectionString()
Gets the database connection string.
Declaration
public static string GetDBConnectionString()
Returns
Type | Description |
---|---|
System.String | The database connection string. |
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 |
Returns
Type | Description |
---|---|
System.String | domain name. |
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. |
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 |
Returns
Type | Description |
---|---|
System.String | domain name. |
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. |
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. |
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. |
GetFileList()
Gets the file list.
Declaration
public static ArrayList GetFileList()
Returns
Type | Description |
---|---|
ArrayList | file list. |
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. |
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 |
System.String | folder | The folder. |
System.Boolean | includeHidden | if set to |
Returns
Type | Description |
---|---|
ArrayList | file list. |
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 |
System.String | folder | The folder. |
Returns
Type | Description |
---|---|
ArrayList | file list. |
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 |
Returns
Type | Description |
---|---|
ArrayList | file list. |
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. |
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. |
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. |
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. |
GetHostPortalSettings()
Gets the host portal settings.
Declaration
public static PortalSettings GetHostPortalSettings()
Returns
Type | Description |
---|---|
PortalSettings | Host portal settings. |
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. |
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. |
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. |
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 |
System.Boolean | blnAddHTTP | if set to |
Returns
Type | Description |
---|---|
System.String | domain name. |
GetPortalSettings()
Gets the portal settings.
Declaration
public static PortalSettings GetPortalSettings()
Returns
Type | Description |
---|---|
PortalSettings | Portal settings. |
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. |
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. |
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. |
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. |
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 |
Returns
Type | Description |
---|---|
System.Int32 | The total number of records in the data reader. |
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. |
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. |
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). |
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. |
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. |
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 SourceIsAdminControl()
Determines whether current request contains admin control information.
Declaration
public static bool IsAdminControl()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsAdminSkin()
Determines whether current request use admin skin.
Declaration
public static bool IsAdminSkin()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsEditMode()
Returns whether the current tab is in EditMode.
Declaration
public static bool IsEditMode()
Returns
Type | Description |
---|---|
System.Boolean |
|
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 |
IsLayoutMode()
Returns whether the current tab is in LayoutMode.
Declaration
public static bool IsLayoutMode()
Returns
Type | Description |
---|---|
System.Boolean |
|
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 |
System.Boolean | forceDownload | if set to |
System.Int32 | portalId | The portal id. |
System.Boolean | enableUrlLanguage | if set to |
System.String | portalGuid | The portal GUID. |
Returns
Type | Description |
---|---|
System.String | Formatted url. |
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 |
System.Boolean | forceDownload | if set to |
Returns
Type | Description |
---|---|
System.String | Formatted url. |
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 |
System.String | contentType | Type of the content. |
Returns
Type | Description |
---|---|
System.String | Formatted url. |
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 |
Returns
Type | Description |
---|---|
System.String | Formatted url. |
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. |
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. |
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 |
IPortalSettings | portalSettings | The Portal Settings. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
PortalSettings | portalSettings | The Portal Settings. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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.
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. |
NavigateURL()
Gets the URL to the current page.
Declaration
public static string NavigateURL()
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
System.String[] | additionalParameters | Any additional parameters. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
PortalSettings | settings | The portal settings. |
System.String | controlKey | The control key, or |
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. |
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 |
PortalSettings | settings | The portal settings. |
System.String | controlKey | The control key, or |
System.String | language | The language code. |
System.String[] | additionalParameters | Any additional parameters. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
PortalSettings | settings | The portal settings. |
System.String | controlKey | The control key, or |
System.String[] | additionalParameters | Any additional parameters. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
System.String[] | additionalParameters | Any additional parameters. |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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. |
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 |
System.String[] | additionalParameters | Any additional parameters, in |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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 |
Returns
Type | Description |
---|---|
System.String | Formatted URL. |
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.
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. |
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. |
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 |
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. |
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. |
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.
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.
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.
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.
SetFormFocus(Control)
Sets the form focus.
Declaration
public static void SetFormFocus(Control control)
Parameters
Type | Name | Description |
---|---|---|
Control | control | The control. |
SetStatus(Globals.UpgradeStatus)
Sets the status.
Declaration
public static void SetStatus(Globals.UpgradeStatus status)
Parameters
Type | Name | Description |
---|---|---|
Globals.UpgradeStatus | status | The status. |
UpdateDataBaseVersion(Version)
Updates the database version.
Declaration
public static void UpdateDataBaseVersion(Version version)
Parameters
Type | Name | Description |
---|---|---|
Version | version | The version. |
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. |
UsePortNumber()
Determin whether use port number by the value in config file.
Declaration
public static bool UsePortNumber()
Returns
Type | Description |
---|---|
System.Boolean |
|
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).
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).
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).
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. |
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 |
|
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 |
|
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. |