FormsAuthentication::EnableFormsAuthentication Method (NameValueCollection^)

.NET Framework (current version)
 

Enables forms authentication.

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

public:
static void EnableFormsAuthentication(
	NameValueCollection^ configurationData
)

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: