George2
George2

Reputation: 45801

ASP.Net Forms authentication provider issue

I am using VSTS 2008 + .Net 3.5 + ASP.Net to develop a simple web application. And I am using Forms authentication for my web site (I use command aspnet_regsql.exe to create a new database in SQL Server 2008 Enterprise to host database for Forms Authentication. I am not using SQL Server Express.).

I am learning Forms authentication from here,

http://msdn.microsoft.com/en-us/library/ff648345.aspx#paght000022_usingthesqlmembershipprovider

my question is for the name of membership defaultProvider, the value must be "SqlProvider"? Or I can use any arbitrary name, for example like this (I replace the value "SqlProvider" to "MyTestSqlProvider")?

<connectionStrings>
  <add name="MySqlConnection" connectionString="Data Source=MySqlServer;Initial Catalog=aspnetdb;Integrated Security=SSPI;" />
</connectionStrings>
<system.web>
...
  <membership defaultProvider="MyTestSqlProvider" userIsOnlineTimeWindow="15">
    <providers>
      <clear />
      <add 
        name="MyTestSqlProvider" 
        type="System.Web.Security.SqlMembershipProvider" 
        connectionStringName="MySqlConnection"
        applicationName="MyApplication"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        requiresUniqueEmail="true"
        passwordFormat="Hashed" />
    </providers>
  </membership>

Upvotes: 1

Views: 277

Answers (1)

Dean Harding
Dean Harding

Reputation: 72668

What you have there is perfectly find. The name is just there so you can refer to that particular provider. So as long as the name is unqiue, then it doesn't really matter what it is (you could call it "BlahBlahGoobledegook" and it wouldn't matter.

Upvotes: 1

Related Questions