Επεξεργασία

Κοινή χρήση μέσω


FormsAuthenticationConfiguration.DefaultUrl Property

Definition

Gets or sets the default URL.

public:
 property System::String ^ DefaultUrl { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("defaultUrl", DefaultValue="default.aspx")]
[System.Configuration.StringValidator(MinLength=1)]
public string DefaultUrl { get; set; }
[<System.Configuration.ConfigurationProperty("defaultUrl", DefaultValue="default.aspx")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.DefaultUrl : string with get, set
Public Property DefaultUrl As String

Property Value

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

Attributes

Examples

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 =
    formsAuthentication.DefaultUrl;

// Set current DefaultUrl.
formsAuthentication.DefaultUrl = "newDefaultUrl";
' Get current DefaultUrl.
Dim currentDefaultUrl As String =
formsAuthentication.DefaultUrl

' Set current DefaultUrl.
formsAuthentication.DefaultUrl = "newDefaultUrl"

Remarks

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

Applies to