Class UrlHelperExtensions
- Namespace
- Umbraco.Extensions
- Assembly
- Umbraco.Web.Common.dll
public static class UrlHelperExtensions
- Inheritance
-
UrlHelperExtensions
- Inherited Members
Methods
GetCacheBustHash(IHostingEnvironment, IUmbracoVersion)
public static string GetCacheBustHash(IHostingEnvironment hostingEnvironment, IUmbracoVersion umbracoVersion)
Parameters
hostingEnvironment
IHostingEnvironmentumbracoVersion
IUmbracoVersion
Returns
GetCropUrl(IUrlHelper, IPublishedContent?, int?, int?, string, string?, int?, ImageCropMode?, ImageCropAnchor?, bool, bool, bool, string?, bool, UrlMode)
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper, IPublishedContent? mediaItem, int? width = null, int? height = null, string propertyAlias = "umbracoFile", string? cropAlias = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, bool cacheBuster = true, string? furtherOptions = null, bool htmlEncode = true, UrlMode urlMode = 0)
Parameters
urlHelper
IUrlHelpermediaItem
IPublishedContentwidth
int?height
int?propertyAlias
stringcropAlias
stringquality
int?imageCropMode
ImageCropMode?imageCropAnchor
ImageCropAnchor?preferFocalPoint
booluseCropDimensions
boolcacheBuster
boolfurtherOptions
stringhtmlEncode
boolurlMode
UrlMode
Returns
GetCropUrl(IUrlHelper, IPublishedContent?, string, bool, UrlMode)
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper, IPublishedContent? mediaItem, string cropAlias, bool htmlEncode = true, UrlMode urlMode = 0)
Parameters
urlHelper
IUrlHelpermediaItem
IPublishedContentcropAlias
stringhtmlEncode
boolurlMode
UrlMode
Returns
GetCropUrl(IUrlHelper, IPublishedContent?, string, string, bool, UrlMode)
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper, IPublishedContent? mediaItem, string propertyAlias, string cropAlias, bool htmlEncode = true, UrlMode urlMode = 0)
Parameters
urlHelper
IUrlHelpermediaItem
IPublishedContentpropertyAlias
stringcropAlias
stringhtmlEncode
boolurlMode
UrlMode
Returns
GetCropUrl(IUrlHelper, ImageCropperValue?, string, int?, int?, int?, ImageCropMode?, ImageCropAnchor?, bool, bool, string?, string?, bool)
public static IHtmlContent GetCropUrl(this IUrlHelper urlHelper, ImageCropperValue? imageCropperValue, string cropAlias, int? width = null, int? height = null, int? quality = null, ImageCropMode? imageCropMode = null, ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = true, string? cacheBusterValue = null, string? furtherOptions = null, bool htmlEncode = true)
Parameters
urlHelper
IUrlHelperimageCropperValue
ImageCropperValuecropAlias
stringwidth
int?height
int?quality
int?imageCropMode
ImageCropMode?imageCropAnchor
ImageCropAnchor?preferFocalPoint
booluseCropDimensions
boolcacheBusterValue
stringfurtherOptions
stringhtmlEncode
bool
Returns
GetUmbracoApiService(IUrlHelper, string, string, object?)
Return the Url for a Web Api service
public static string? GetUmbracoApiService(this IUrlHelper url, string actionName, string controllerName, object? id = null)
Parameters
url
IUrlHelperactionName
stringcontrollerName
stringid
object
Returns
GetUmbracoApiService(IUrlHelper, string, string, string, object?)
Return the Url for a Web Api service
public static string? GetUmbracoApiService(this IUrlHelper url, string actionName, string controllerName, string area, object? id = null)
Parameters
url
IUrlHelperactionName
stringcontrollerName
stringarea
stringid
object
Returns
GetUmbracoApiService(IUrlHelper, UmbracoApiControllerTypeCollection, string, Type, object?)
Return the Url for a Web Api service
[Obsolete("This will be removed in Umbraco 15.")]
public static string? GetUmbracoApiService(this IUrlHelper url, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, string actionName, Type apiControllerType, object? id = null)
Parameters
url
IUrlHelperumbracoApiControllerTypeCollection
UmbracoApiControllerTypeCollectionactionName
stringapiControllerType
Typeid
object
Returns
GetUmbracoApiServiceBaseUrl<T>(IUrlHelper, UmbracoApiControllerTypeCollection, Expression<Func<T, object>>)
[Obsolete("This will be removed in Umbraco 15.")]
public static string? GetUmbracoApiServiceBaseUrl<T>(this IUrlHelper url, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, Expression<Func<T, object>> methodSelector) where T : UmbracoApiController
Parameters
url
IUrlHelperumbracoApiControllerTypeCollection
UmbracoApiControllerTypeCollectionmethodSelector
Expression<Func<T, object>>
Returns
Type Parameters
T
GetUmbracoApiServiceBaseUrl<T>(IUrlHelper, UmbracoApiControllerTypeCollection, string)
Return the Base Url (not including the action) for a Web Api service
[Obsolete("This will be removed in Umbraco 15.")]
public static string? GetUmbracoApiServiceBaseUrl<T>(this IUrlHelper url, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, string actionName) where T : UmbracoApiController
Parameters
url
IUrlHelperumbracoApiControllerTypeCollection
UmbracoApiControllerTypeCollectionactionName
string
Returns
Type Parameters
T
GetUmbracoApiService<T>(IUrlHelper, UmbracoApiControllerTypeCollection, Expression<Func<T, object>>)
[Obsolete("This will be removed in Umbraco 15.")]
public static string? GetUmbracoApiService<T>(this IUrlHelper url, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, Expression<Func<T, object>> methodSelector) where T : UmbracoApiController
Parameters
url
IUrlHelperumbracoApiControllerTypeCollection
UmbracoApiControllerTypeCollectionmethodSelector
Expression<Func<T, object>>
Returns
Type Parameters
T
GetUmbracoApiService<T>(IUrlHelper, UmbracoApiControllerTypeCollection, string, object?)
Return the Url for a Web Api service
[Obsolete("This will be removed in Umbraco 15.")]
public static string? GetUmbracoApiService<T>(this IUrlHelper url, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, string actionName, object? id = null) where T : UmbracoApiController
Parameters
url
IUrlHelperumbracoApiControllerTypeCollection
UmbracoApiControllerTypeCollectionactionName
stringid
object
Returns
Type Parameters
T
GetUrlWithCacheBust(IUrlHelper, string, string, RouteValueDictionary, IHostingEnvironment, IUmbracoVersion)
Return the Url for an action with a cache-busting hash appended
public static string GetUrlWithCacheBust(this IUrlHelper url, string actionName, string controllerName, RouteValueDictionary routeVals, IHostingEnvironment hostingEnvironment, IUmbracoVersion umbracoVersion)
Parameters
url
IUrlHelperactionName
stringcontrollerName
stringrouteVals
RouteValueDictionaryhostingEnvironment
IHostingEnvironmentumbracoVersion
IUmbracoVersion
Returns
SurfaceAction(IUrlHelper, IUmbracoContext, IDataProtectionProvider, string, string)
Generates a URL based on the current Umbraco URL with a custom query string that will route to the specified SurfaceController
public static string SurfaceAction(this IUrlHelper url, IUmbracoContext umbracoContext, IDataProtectionProvider dataProtectionProvider, string action, string controllerName)
Parameters
url
IUrlHelperumbracoContext
IUmbracoContextdataProtectionProvider
IDataProtectionProvideraction
stringcontrollerName
string
Returns
SurfaceAction(IUrlHelper, IUmbracoContext, IDataProtectionProvider, string, string, object?)
Generates a URL based on the current Umbraco URL with a custom query string that will route to the specified SurfaceController
public static string SurfaceAction(this IUrlHelper url, IUmbracoContext umbracoContext, IDataProtectionProvider dataProtectionProvider, string action, string controllerName, object? additionalRouteVals)
Parameters
url
IUrlHelperumbracoContext
IUmbracoContextdataProtectionProvider
IDataProtectionProvideraction
stringcontrollerName
stringadditionalRouteVals
object
Returns
SurfaceAction(IUrlHelper, IUmbracoContext, IDataProtectionProvider, string, string, string, object?)
Generates a URL based on the current Umbraco URL with a custom query string that will route to the specified SurfaceController
public static string SurfaceAction(this IUrlHelper url, IUmbracoContext umbracoContext, IDataProtectionProvider dataProtectionProvider, string action, string controllerName, string area, object? additionalRouteVals)
Parameters
url
IUrlHelperumbracoContext
IUmbracoContextdataProtectionProvider
IDataProtectionProvideraction
stringcontrollerName
stringarea
stringadditionalRouteVals
object