LoginUrl Property

FormsAuthenticationConfiguration.LoginUrl Property

Gets or sets the redirection URL for the request.

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

public string LoginUrl { get; set; }
/** @property */
public String get_LoginUrl ()

/** @property */
public void set_LoginUrl (String value)

public function get LoginUrl () : String

public function set LoginUrl (value : String)

Not applicable.

Property Value

The URL the request is redirected to when the user is not authenticated. The default value is login.aspx.

The LoginUrl property specifies the redirection URL for the request when the user is not authenticated or when no valid authentication cookie exists.

The following code example shows how to access the LoginUrl. Refer to the code example in the FormsAuthenticationConfiguration class topic to learn how to get the section.

// Get the current LoginUrl.
string currentLoginUrl = formsAuthentication.LoginUrl;

// Set the LoginUrl. 
formsAuthentication.LoginUrl = "newLoginUrl";

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

Community Additions

© 2016 Microsoft