SPUtility.Redirect method (String, SPRedirectFlags, HttpContext)
Handles the redirection of an HTTP request.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function Redirect ( _
url As String, _
flags As SPRedirectFlags, _
context As HttpContext _
) As Boolean
'Usage
Dim url As String
Dim flags As SPRedirectFlags
Dim context As HttpContext
Dim returnValue As Boolean
returnValue = SPUtility.Redirect(url, _
flags, context)
public static bool Redirect(
string url,
SPRedirectFlags flags,
HttpContext context
)
Parameters
url
Type: System.StringThe destination URL to be used in the redirection.
flags
Type: Microsoft.SharePoint.Utilities.SPRedirectFlagsA valid combination of flags from the SPRedirectFlags enumeration that indicate how the redirection should be made
context
Type: System.Web.HttpContextThe HTTPContext object that provides HTTP information about the current HTTP request.
Return value
Type: System.Boolean
This method returns true if the redirection was made; otherwise this method returns false.
Remarks
This method redirects to the URL specified in the url parameter.
This method performs validation of the URL depending on the flags set in the SPRedirectFlags enumeration. Set the SPRedirectFlags.Trusted flag to ensure that the URL is valid without checking whether the URL destination is located on a local server. To perform the redirection without validation, set the SPRedirectFlags.Static flag.