Share via


IUrlHelper.Link(String, Object) Method

Definition

Generates an absolute URL for the specified routeName and route values, which contains the protocol (such as "http" or "https") and host name from the current request. See the remarks section for important security information.

public:
 System::String ^ Link(System::String ^ routeName, System::Object ^ values);
public string Link (string routeName, object values);
public string? Link (string? routeName, object? values);
abstract member Link : string * obj -> string
Public Function Link (routeName As String, values As Object) As String

Parameters

routeName
String

The name of the route that is used to generate URL.

values
Object

An object that contains route values.

Returns

The generated absolute URL.

Remarks

This method uses the value of Host to populate the host section of the generated URI. Relying on the value of the current request can allow untrusted input to influence the resulting URI unless the Host header has been validated. See the deployment documentation for instructions on how to properly validate the Host header in your deployment environment.

Applies to