Nucleus .Net Core CMS

UrlHelperExtensions Class

Namespace: Nucleus.ViewFeatures
Assembly: Nucleus.ViewFeatures.dll
Extensions used to render links to Nucleus pages, files and actions.

Methods

RelativePageLink (Page) Method

RelativePageLink (Page page)
Output an relative url, with the leading "~" character for use by UrlHelper.Content for the specified Models.Page.
Parameters
Name Type
page Nucleus.Abstractions.Models.Page

PageLink (IUrlHelper,Page) Method

PageLink (IUrlHelper helper, Page page)
Output an url for the specified Models.Page.

PageLink (IUrlHelper,Page,String) Method

PageLink (IUrlHelper helper, Page page, String relativePath)
Output an url for the specified Models.Page with relativePath appended."/>.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
page Nucleus.Abstractions.Models.Page
relativePath String

FileLink (IUrlHelper,File) Method

FileLink (IUrlHelper helper, File file)
Output an url for the specified Models.FileSystem.File.
Remarks
This overload is intended for use as an Url extension method.

FileLink (IUrlHelper,File,Boolean) Method

FileLink (IUrlHelper helper, File file, Boolean inline)
Output an url for the specified Models.FileSystem.File.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
file Nucleus.Abstractions.Models.FileSystem.File
inline Boolean

Specifies whether the link should output a content-disposition header which renders the content inline, or as an attachment. When a file is output with content-disposition: attachment, browsers typically download the file rather than displaying it.

Remarks
This overload is intended for use as an Url extension method.

FileLink (IUrlHelper,File,Boolean,Boolean) Method

FileLink (IUrlHelper helper, File file, Boolean inline, Boolean encodePath)
Output an url for the specified Models.FileSystem.File.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
file Nucleus.Abstractions.Models.FileSystem.File
inline Boolean

Specifies whether the link should output a content-disposition header which renders the content inline, or as an attachment. When a file is output with content-disposition: attachment, browsers typically download the file rather than displaying it.

encodePath Boolean

AreaAction (IUrlHelper,String,String,String) Method

AreaAction (IUrlHelper helper, String actionName, String controllerName, String areaName)
Generates a fully qualified URL to an action method by using the specified action name, controller name and area name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String

The action name.

controllerName String

The controller name.

areaName String

The area name.

AreaAction (IUrlHelper,String,String,String,Object) Method

AreaAction (IUrlHelper helper, String actionName, String controllerName, String areaName, Object routeValues)
Generates a fully qualified URL to an action method by using the specified action name, controller name and area name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String

The action name.

controllerName String

The controller name.

areaName String

The area name.

routeValues Object

An object that contains the parameters for a route.

NucleusAction (IUrlHelper,String,String,String) Method

NucleusAction (IUrlHelper helper, String actionName, String controllerName, String extensionName)
Generates a fully qualified URL to an Nucleus extension action method by using the specified action name, controller name and extension name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String
controllerName String
extensionName String

NucleusAction (IUrlHelper,String,String,String,Object) Method

NucleusAction (IUrlHelper helper, String actionName, String controllerName, String extensionName, Object routeValues)
Generates a fully qualified URL to an Nucleus extension action method by using the specified action name, controller name and extension name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String
controllerName String
extensionName String
routeValues Object

NucleusAction (IUrlHelper,String,String,String,String) Method

NucleusAction (IUrlHelper helper, String actionName, String controllerName, String areaName, String extensionName)
Generates a fully qualified URL to an Nucleus extension action method by using the specified action name, controller name and extension name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String
controllerName String
areaName String
extensionName String

NucleusAction (IUrlHelper,String,String,String,String,Object) Method

NucleusAction (IUrlHelper helper, String actionName, String controllerName, String areaName, String extensionName, Object routeValues)
Generates a fully qualified URL to an Nucleus extension action method by using the specified action name, controller name and extension name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String
controllerName String
areaName String
extensionName String
routeValues Object

ApiAction (IUrlHelper,String,String,String) Method

ApiAction (IUrlHelper helper, String actionName, String controllerName, String extensionName)
Generates a fully qualified URL to an Nucleus extension API method by using the specified action name and controller name and extension name.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
actionName String
controllerName String
extensionName String

GetAbsoluteUri (IUrlHelper,String) Method

GetAbsoluteUri (IUrlHelper helper, String localPath)
Returns an absolute Url for the specified local path.
Parameters
Name Type
helper Microsoft.AspNetCore.Mvc.IUrlHelper
localPath String
Remarks
If required, callers must call IUriHelper.Content to parse '~' in the path, this function assumes that localPath is an actual path with no special characters