Membership

Discussion in 'ASP.NET 2.0' started by JHunt, Mar 29, 2006.

  1. I have been experiencing problems with getting the membership working on discountasp.net. It works locally, but not once the site is published. using the VS2K5 SE IDE. I am able to connect and create users using the Web Site Administration Tool but, when the user tries to log in there is no authentication. Areas within the site cannot be accessed. I have an open ticket, but the Database guys helping say that it must be due to an incorrect connectionString. I don't think that this is possible otherwise I wouldn't be able to connect with the Admin tool and create users. Anyway, I'll post my web.config and hopefully someone will have an idea... I'm nearly all out.







    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">


    <connectionStrings>


    <remove name="LocalSqlServer" />


    <add name="LocalSqlServer" connectionString="Data Source=sql2k501.discountasp.net;Initial Catalog=<##Database Name##>;User Id=<##UserName##>;pwd=<##UserName##>" />


    </connectionStrings>


    <appSettings/>


    <system.web>


    <customErrors defaultRedirect="~/Error.aspx" />


    <authentication mode="Forms">


    <forms name="MySiteAuthenticationCookie" loginUrl="Login.aspx"


    timeout="10" path="/MySite" cookieless="AutoDetect" />


    </authentication>


    <authorization>


    <allow users="*"/>


    </authorization>


    <roleManager enabled="true" defaultProvider="SqlRoleManager">


    <providers>


    <remove name="SqlRoleManager" />


    <clear />


    <add connectionStringName="LocalSqlServer" name="SqlRoleManager" applicationName="/MySite.com"


    type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


    </providers>


    </roleManager>


    <membership defaultProvider="SqlMembershipProvider">


    <providers>


    <remove name="SqlMembershipProvider" />


    <clear />


    <add connectionStringName="LocalSqlServer" name="SqlMembershipProvider" applicationName="/MySite.com"


    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


    </providers>


    </membership>


    <compilation debug="true"/>


    <pages theme="Default" />


    </system.web>


    </configuration>
     
  2. Two things I see that could be a problem.

    1. The authorization part of your code:

     
  3. Thank you!
    The part about the path was what solved my problem. The authentication element added was a recommendation by the support team. The default page on my site has no authetication requirements ans is available to the public. I do, though have a restricted area that has its own web.config restricting unauthenticated users from accessing it.
     

Share This Page