FormsAuthentication.EnableFormsAuthentication Method (NameValueCollection)

.NET Framework (current version)
 
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.

Enables forms authentication.

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

Public Shared Sub EnableFormsAuthentication (
	configurationData As NameValueCollection
)

Parameters

configurationData
Type: System.Collections.Specialized.NameValueCollection

A name-value collection that contains values for "defaultUrl" and/or "loginUrl". The parameter can be null if there are no values for the default URL or the login URL.

Exception Condition
InvalidOperationException

The application is not in the pre-start initialization phase.

If the DefaultUrl property is null, that property is set to the default URL value from the configurationData parameter. If the LoginUrl property is null, that property is set to the login URL value from the configurationData parameter.

.NET Framework
Available since 4.0
Return to top
Show: