Redigera

Dela via


HttpContextWrapper.RewritePath Method

Definition

Assigns an internal rewrite path, which lets the requested URL differ from the internal path of the resource.

Overloads

RewritePath(String, String, String, Boolean)

Rewrites the URL by using the specified path, path information, query string information, and a value that specifies whether the client file path is set to the rewrite path.

RewritePath(String, String, String)

Rewrites the URL by using the specified path, path information, and query string information.

RewritePath(String, Boolean)

Rewrites the URL by using the specified path and a value that specifies whether the virtual path for server resources is modified.

RewritePath(String)

Rewrites the URL by using the specified path.

RewritePath(String, String, String, Boolean)

Rewrites the URL by using the specified path, path information, query string information, and a value that specifies whether the client file path is set to the rewrite path.

public:
 override void RewritePath(System::String ^ filePath, System::String ^ pathInfo, System::String ^ queryString, bool setClientFilePath);
public override void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath);
override this.RewritePath : string * string * string * bool -> unit
Public Overrides Sub RewritePath (filePath As String, pathInfo As String, queryString As String, setClientFilePath As Boolean)

Parameters

filePath
String

The replacement path.

pathInfo
String

Additional path information for a resource.

queryString
String

The request query string.

setClientFilePath
Boolean

true to set the file path used for client resources to the value of the filePath parameter; otherwise, false.

Exceptions

filePath is null.

filePath is not in the current application's root directory.

Applies to

RewritePath(String, String, String)

Rewrites the URL by using the specified path, path information, and query string information.

public:
 override void RewritePath(System::String ^ filePath, System::String ^ pathInfo, System::String ^ queryString);
public override void RewritePath (string filePath, string pathInfo, string queryString);
override this.RewritePath : string * string * string -> unit
Public Overrides Sub RewritePath (filePath As String, pathInfo As String, queryString As String)

Parameters

filePath
String

The replacement path.

pathInfo
String

Additional path information for a resource.

queryString
String

The request query string.

Exceptions

The filePath parameter is null.

The filePath parameter is not in the current application's root directory.

Applies to

RewritePath(String, Boolean)

Rewrites the URL by using the specified path and a value that specifies whether the virtual path for server resources is modified.

public:
 override void RewritePath(System::String ^ path, bool rebaseClientPath);
public override void RewritePath (string path, bool rebaseClientPath);
override this.RewritePath : string * bool -> unit
Public Overrides Sub RewritePath (path As String, rebaseClientPath As Boolean)

Parameters

path
String

The path to rewrite to.

rebaseClientPath
Boolean

true to reset the virtual path; false to keep the virtual path unchanged.

Exceptions

path is null.

path is not in the current application's root directory.

Applies to

RewritePath(String)

Rewrites the URL by using the specified path.

public:
 override void RewritePath(System::String ^ path);
public override void RewritePath (string path);
override this.RewritePath : string -> unit
Public Overrides Sub RewritePath (path As String)

Parameters

path
String

The replacement path.

Exceptions

path is null.

path is not in the current application's root directory.

Applies to