Once our providers are written, we need to let ASP.NET know that we are going to use them. The first thing we need to do is go into the Web.config
and change the authentication method in the system.web
section from Windows
to Forms
. To do this, we literally just change the value to Forms
as follows:
<authentication mode="Forms"/>
One thing we should also specify here is the URL of the login page in case our user tries to go to a secure page without being logged in (that is, from a bookmark). We can use the loginUrl
property of the forms
tag to handle this as follows:
<authentication mode="Forms"> <forms loginUrl="~/Login.aspx"/> </authentication>
Next, we need to add a configuration block to define the membership provider. This is done using the <membership>
block and a <providers>
block to actually define the provider itself.
The
<membership>
block has a parameter defaultProvider
where you can provide the name of the default...