views:

24

answers:

1

Hello everyone,

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>

thanks in advance, George

+1  A: 

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.

Dean Harding
So, I can use my special provider name "MyTestSqlProvider" along with the specific type name "System.Web.Security.SqlMembershipProvider"? Means, no matter what provider names I am using, I can use "System.Web.Security.SqlMembershipProvider" as type?
George2
That's correct, yes.
Dean Harding
Thanks, question answered!
George2