HttpContext.RewritePath Method (String, String, String)

Rewrites the URL using the given path, path information, and a Boolean value that specifies whether the virtual path for server resources is modified.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public:
void RewritePath (
	String^ filePath, 
	String^ pathInfo, 
	String^ queryString
)
public void RewritePath (
	String filePath, 
	String pathInfo, 
	String queryString
)
public function RewritePath (
	filePath : String, 
	pathInfo : String, 
	queryString : String
)
Not applicable.

Parameters

filePath

The internal rewrite path.

pathInfo

Additional path information for a resource.

queryString

The request query string.

Exception typeCondition

ArgumentNullException

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

HttpException

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

The RewritePath method redirects a request for a resource to another resource without changing the URL.

The filePath parameter does not include the pathInfo parameter content. For the URL http://www.microsoft.com/virdir/page.html/tail, the filePath parameter is http://www.microsoft.com/virdir/page.html, and the pathInfo parameter is tail.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show: