Class ApplicationUrlHelper
A helper used to determine the current server umbraco application URL.
Inheritance
System.Object
Namespace: Umbraco.Core.Sync
Assembly: Umbraco.Core.dll
Syntax
public static class ApplicationUrlHelper
Properties
View SourceApplicationUrlProvider
Gets or sets a custom provider for the umbraco application URL.
Declaration
public static Func<HttpRequestBase, string> ApplicationUrlProvider { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Web.HttpRequestBase, System.String> |
Remarks
Receives the current request as a parameter, and it may be null. Must return a properly
formatted URL with scheme and umbraco dir and no trailing slash eg "http://www.mysite.com/umbraco",
or null
. To be used in auto-load-balancing scenarios where the application URL is not
in config files but is determined programmatically.
Must be assigned before resolution is frozen.
Methods
View SourceGetApplicationUriUncached(HttpRequestBase, IUmbracoSettingsSection, IGlobalSettings)
Will get the application URL from configuration, if none is specified will fall back to URL from request.
Declaration
public static Uri GetApplicationUriUncached(HttpRequestBase request, IUmbracoSettingsSection umbracoSettingsSection, IGlobalSettings globalSettings)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | request | |
IUmbracoSettingsSection | umbracoSettingsSection | |
IGlobalSettings | globalSettings |
Returns
Type | Description |
---|---|
System.Uri |
GetApplicationUrlFromCurrentRequest(HttpRequestBase, IGlobalSettings)
Declaration
public static string GetApplicationUrlFromCurrentRequest(HttpRequestBase request, IGlobalSettings globalSettings)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | request | |
IGlobalSettings | globalSettings |
Returns
Type | Description |
---|---|
System.String |