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

Class UrlUtils

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Inheritance
System.Object
UrlUtils
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public static class UrlUtils : object

Methods

| Improve this Doc View Source

ClosePopUp(Boolean, String, Boolean)

Creates a URL (or script) to close a pop-up.

Declaration
public static string ClosePopUp(bool refresh, string url, bool onClickEvent)
Parameters
Type Name Description
System.Boolean refresh

Whether to refresh the page when the pop-up is closed.

System.String url

The URL.

System.Boolean onClickEvent

Whether to generate a script for an onClick event (rather than a URL with a javascript: protocol).

Returns
Type Description
System.String

The URL or script.

| Improve this Doc View Source

Combine(String, String)

Combines two URLs, trimming any slashes between them.

Declaration
public static string Combine(string baseUrl, string relativeUrl)
Parameters
Type Name Description
System.String baseUrl

The base URL.

System.String relativeUrl

The URL to add to the base URL.

Returns
Type Description
System.String

A new URL that combines baseUrl and relativeUrl.

| Improve this Doc View Source

DecodeParameter(String)

Decodes a base64 encoded value generated via EncodeParameter(String).

Declaration
public static string DecodeParameter(string value)
Parameters
Type Name Description
System.String value

The encoded value.

Returns
Type Description
System.String

The decoded value.

| Improve this Doc View Source

DecryptParameter(String, String)

Decrypts an encrypted value generated via EncryptParameter(String, String).

Declaration
public static string DecryptParameter(string value, string encryptionKey)
Parameters
Type Name Description
System.String value

The encrypted value.

System.String encryptionKey

The key used to encrypt the value.

Returns
Type Description
System.String

The decrypted value.

| Improve this Doc View Source

DecryptParameter(String)

Decrypts an encrypted value generated via EncryptParameter(String). Decrypted using the current portal's GUID.

Declaration
public static string DecryptParameter(string value)
Parameters
Type Name Description
System.String value

The encrypted value.

Returns
Type Description
System.String

The decrypted value.

| Improve this Doc View Source

EncodeParameter(String)

Encodes a value (using base64) for placing in a URL.

Declaration
public static string EncodeParameter(string value)
Parameters
Type Name Description
System.String value

The value to encode.

Returns
Type Description
System.String

The encoded value.

| Improve this Doc View Source

EncryptParameter(String, String)

Encrypt a parameter for placing in a URL.

Declaration
public static string EncryptParameter(string value, string encryptionKey)
Parameters
Type Name Description
System.String value

The value to encrypt.

System.String encryptionKey

The key to use when encrypting the value. This key must be used to decrypt the value.

Returns
Type Description
System.String

The encrypted value.

| Improve this Doc View Source

EncryptParameter(String)

Encrypt a parameter for placing in a URL. Encrypted using the current portal's GUID.

Declaration
public static string EncryptParameter(string value)
Parameters
Type Name Description
System.String value

The value to encrypt.

Returns
Type Description
System.String

The encrypted value.

| Improve this Doc View Source

GetParameterName(String)

Gets the name from a query string pair.

Declaration
public static string GetParameterName(string pair)
Parameters
Type Name Description
System.String pair

The pair, e.g. "name=value".

Returns
Type Description
System.String

The name.

| Improve this Doc View Source

GetParameterValue(String)

Gets the value from a query string pair.

Declaration
public static string GetParameterValue(string pair)
Parameters
Type Name Description
System.String pair

The pair, e.g. "name=value".

Returns
Type Description
System.String

The value.

| Improve this Doc View Source

GetQSParamsForNavigateURL()

getQSParamsForNavigateURL builds up a new querystring. This is necessary in order to prep for navigateUrl. we don't ever want a tabid, a ctl and a language parameter in the qs either, the portalid param is not allowed when the tab is a supertab (because NavigateUrl adds the portalId param to the qs).

Declaration
public static string[] GetQSParamsForNavigateURL()
Returns
Type Description
System.String[]

The query-string parameters collection in "key=value" format.

| Improve this Doc View Source

Handle404Exception(HttpResponse, PortalSettings)

Redirect current response to 404 error page or output 404 content if error page not defined.

Declaration
public static void Handle404Exception(HttpResponse response, PortalSettings portalSetting)
Parameters
Type Name Description
HttpResponse response

The response.

PortalSettings portalSetting

The portal settings.

| Improve this Doc View Source

InPopUp()

Determines whether the current page is being shown in a pop-up.

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

true if the current page is in a pop-up, otherwise false.

| Improve this Doc View Source

IsPopUp(String)

Determines whether the given URL is for a page being shown in a pop-up.

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

The URL.

Returns
Type Description
System.Boolean

true if the URL is for a page in a pop-up, otherwise false.

| Improve this Doc View Source

IsSecureConnectionOrSslOffload(HttpRequest)

check if connection is HTTPS or is HTTP but with ssloffload enabled on a secure page.

Declaration
public static bool IsSecureConnectionOrSslOffload(HttpRequest request)
Parameters
Type Name Description
HttpRequest request

current request.

Returns
Type Description
System.Boolean

true if HTTPS or if HTTP with an SSL offload header value, false otherwise.

| Improve this Doc View Source

IsSslOffloadEnabled(HttpRequest)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static bool IsSslOffloadEnabled(HttpRequest request)
Parameters
Type Name Description
HttpRequest request
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OpenNewWindow(Page, Type, String)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static void OpenNewWindow(Page page, Type type, string url)
Parameters
Type Name Description
Page page
Type type
System.String url
| Improve this Doc View Source

PopUpUrl(String, Control, PortalSettings, Boolean, Boolean, Int32, Int32, Boolean, String)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth, bool refresh, string closingUrl)
Parameters
Type Name Description
System.String url
Control control
PortalSettings portalSettings
System.Boolean onClickEvent
System.Boolean responseRedirect
System.Int32 windowHeight
System.Int32 windowWidth
System.Boolean refresh
System.String closingUrl
Returns
Type Description
System.String
| Improve this Doc View Source

PopUpUrl(String, Control, PortalSettings, Boolean, Boolean, Int32, Int32)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth)
Parameters
Type Name Description
System.String url
Control control
PortalSettings portalSettings
System.Boolean onClickEvent
System.Boolean responseRedirect
System.Int32 windowHeight
System.Int32 windowWidth
Returns
Type Description
System.String
| Improve this Doc View Source

PopUpUrl(String, Control, PortalSettings, Boolean, Boolean)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect)
Parameters
Type Name Description
System.String url
Control control
PortalSettings portalSettings
System.Boolean onClickEvent
System.Boolean responseRedirect
Returns
Type Description
System.String
| Improve this Doc View Source

PopUpUrl(String, PortalSettings, Boolean, Boolean, Int32, Int32)

Provides utilities for dealing with DNN's URLs. Consider using if applicable.

Declaration
public static string PopUpUrl(string url, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth)
Parameters
Type Name Description
System.String url
PortalSettings portalSettings
System.Boolean onClickEvent
System.Boolean responseRedirect
System.Int32 windowHeight
System.Int32 windowWidth
Returns
Type Description
System.String
| Improve this Doc View Source

ReplaceQSParam(String, String, String)

Replaces a query string parameter's value in a URL.

Declaration
public static string ReplaceQSParam(string url, string param, string newValue)
Parameters
Type Name Description
System.String url

The URL.

System.String param

The parameter name.

System.String newValue

The parameter value.

Returns
Type Description
System.String

The updated URL.

| Improve this Doc View Source

StripQSParam(String, String)

Removes the query string parameter with the given name from the URL.

Declaration
public static string StripQSParam(string url, string param)
Parameters
Type Name Description
System.String url

The URL.

System.String param

The parameter name.

Returns
Type Description
System.String

The updated URL.

| Improve this Doc View Source

ValidReturnUrl(String)

Determines whether a url is valid as a return URL.

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

The URL string.

Returns
Type Description
System.String

The normalized return URL or .

  • View Source
Back to top by the community, for the community... #DNNCMS