开发者

asp.net create user control & SQL server storage

I am creating a site and adding some users with the create user wizzard, however hosting the site on ASPSpider (free hosting) requires me to attach the database to their server and this process means the database used will not be in the App_Data folder.

I have tried to configure the SQL provider to use the connection string ascociated with the DB

    <membership>
  <providers>
    <add name="createUserSqlMembershipProvider"
    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    connectionStringName="ASPNETDBConnectionString"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    applicationName="/"
    requiresUniqueEmail="false"
    passwordFormat="Hashed"
    maxInvalidPasswordAttempts="5"
    minRequiredPasswordLength="7"
    minRequiredNonalphan开发者_高级运维umericCharacters="1"
    passwordAttemptWindow="10"
    passwordStrengthRegularExpression=""/>
  </providers>
</membership>

However when I then create a user from the site this doesn't use the database I have set up, it creates its own one within the App_Data folder. Any ideas, or if you need more info just let me know?

Another problem is that my login control also needs to use this db but doesn't seem to want to. I know the db is in use because one of the other pages uses it in a page load event to retrieve posts made by users, so the connection string is correct.

Thanks,

Si


Try adding a <clear /> right after your <providers> tag, this will remove the default providers and add only your provider.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜