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
hostingEnvironmentIHostingEnvironmentumbracoVersionIUmbracoVersion
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
urlHelperIUrlHelpermediaItemIPublishedContentwidthint?heightint?propertyAliasstringcropAliasstringqualityint?imageCropModeImageCropMode?imageCropAnchorImageCropAnchor?preferFocalPointbooluseCropDimensionsboolcacheBusterboolfurtherOptionsstringhtmlEncodeboolurlModeUrlMode
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
urlHelperIUrlHelpermediaItemIPublishedContentcropAliasstringhtmlEncodeboolurlModeUrlMode
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
urlHelperIUrlHelpermediaItemIPublishedContentpropertyAliasstringcropAliasstringhtmlEncodeboolurlModeUrlMode
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
urlHelperIUrlHelperimageCropperValueImageCropperValuecropAliasstringwidthint?heightint?qualityint?imageCropModeImageCropMode?imageCropAnchorImageCropAnchor?preferFocalPointbooluseCropDimensionsboolcacheBusterValuestringfurtherOptionsstringhtmlEncodebool
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
urlIUrlHelperactionNamestringcontrollerNamestringidobject
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
urlIUrlHelperactionNamestringcontrollerNamestringareastringidobject
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
urlIUrlHelperumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionactionNamestringapiControllerTypeTypeidobject
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
urlIUrlHelperumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionmethodSelectorExpression<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
urlIUrlHelperumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionactionNamestring
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
urlIUrlHelperumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionmethodSelectorExpression<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
urlIUrlHelperumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionactionNamestringidobject
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
urlIUrlHelperactionNamestringcontrollerNamestringrouteValsRouteValueDictionaryhostingEnvironmentIHostingEnvironmentumbracoVersionIUmbracoVersion
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
urlIUrlHelperumbracoContextIUmbracoContextdataProtectionProviderIDataProtectionProvideractionstringcontrollerNamestring
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
urlIUrlHelperumbracoContextIUmbracoContextdataProtectionProviderIDataProtectionProvideractionstringcontrollerNamestringadditionalRouteValsobject
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
urlIUrlHelperumbracoContextIUmbracoContextdataProtectionProviderIDataProtectionProvideractionstringcontrollerNamestringareastringadditionalRouteValsobject