DefaultUrl Property

FormsAuthenticationConfiguration.DefaultUrl Property

Gets or sets the default URL.

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

public string DefaultUrl { get; set; }
/** @property */
public String get_DefaultUrl ()

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

public function get DefaultUrl () : String

public function set DefaultUrl (value : String)

Not applicable.

Property Value

The URL to which to redirect the request after authentication. The default value is default.aspx.

The DefaultUrl is used if the user accesses the login page directly or if a return URL is not provided.

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

// Get current DefaultUrl.
string currentDefaultUrl = 

// Set current DefaultUrl.
formsAuthentication.DefaultUrl = "newDefaultUrl";

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