FormsAuthentication.RedirectToLoginPage Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Redirects the browser to the login URL with the specified query string.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

static member RedirectToLoginPage : 
        extraQueryString:string -> unit

Parameters

extraQueryString
Type: System.String

The query string to include with the redirect URL.

The RedirectToLoginPage method redirects the browser to the LoginUrl and includes the extraQueryString value as the QueryString for the redirected URL.

The RedirectToLoginPage method does not clear the forms-authentication cookie. You can use the RedirectToLoginPage method in conjunction with the SignOut method to log one user out and allow a different user to log in.

The following code example clears the forms-authentication cookie using the SignOut method and redirects the user to the login page using the RedirectToLoginPage method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: