Can I have duplicate nodes in Web.config and if so, how do I reference the desired node at run-time?
For example, the DNN Web.config contains the following connection string:
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=TestServer\SQLExpress;Initial Catalog=DNNdb;providerName="System.Data.SqlClient" />
</connectionStrings>
I want to maintain the default "Account Login" in the TopPane of my DNN webiste. But I have also developed a custom, user-defined login page that still uses Forms Authentication, without adding the "Account Login" module that ships with DNN. The reason I did this is because I want to use Forms Authentication that accesses the Active Directory on my server, and to my knowledge, you cannot do this with the built-in "Account Login" module. Plus, my boss is not interested in purchasing a 3rd-party module, like the one from DataSpring.
I had no problem developing the custom login page (ADLogin.aspx), but I need to modify the above connection string so that it is more like this:
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=TestServer\SQLExpress;Initial Catalog=DNNdb;providerName="System.Data.SqlClient" />
<add name="ADConnString" connectionString="LDAP://xyz.local.com/CN=Users,DC=xyz,..." />
</connectionStrings>
I need both connection strings. Is having 2 connection strings allowed? If so, how do I get my custom page (ADLogin.aspx) to reference ADConnString at run-time? In addition, the DNN Web.config has:
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" ... />
</providers>
</membership>
I believe that the above provider is used by the built-in "Account Login" module when authenticating users and passwords (among other DNN tasks). I need a membership that points to MyADProv provider without changing the defaultProvider that is already specified by DNN. I need something like:
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" ... />
<add name="MyADProv" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, connectionStringName="ADConnString" />
</providers>
</membership>
Note the 2nd provider (MyADProv) above and it, in turn, points to my 2nd connection string (ADConnString) above. I don't think what I want to do is possible, but if it is, I have not been able to get this to work.
Thanks