Used for so-called "relative URL rewriting" where URL rewriting rules have a variable "{PageName}" which is replaced by the caller's page name using this method. The "~/" section at the beginning is replaced with the absolute path of the calling page, so each rule can function regardless of the page depth and location in the portal hierarchy. Current Request.Url is used as a calling URL. Query parameters from the current page are transferred to the rewritten path, but are copied in "raw" fashion in the query string and are not rewritten. Often used in "subcontainer" controls where URL should point to another rewritten URL, but all present parameters should be retained for parent container.

Namespace: MonoSoftware.MonoX.Utilities
Assembly: MonoX (in MonoX.dll) Version: 5.1.40.5065 (5.1.40.5065)

Syntax

C#
public static string RewritePagePathAndRetainQueryParameters(
	string urlToRewrite
)
Visual Basic
Public Shared Function RewritePagePathAndRetainQueryParameters ( 
	urlToRewrite As String
) As String
Visual C++
public:
static String^ RewritePagePathAndRetainQueryParameters(
	String^ urlToRewrite
)
F#
static member RewritePagePathAndRetainQueryParameters : 
        urlToRewrite : string -> string 

Parameters

urlToRewrite
Type: System..::..String
Url to rewrite.

Return Value

Type: String
Rewritten URL.

See Also