2.0 membership login feature, changing directories

Discussion in 'ASP .Net Security' started by Cindy Lee, Mar 8, 2006.

  1. Cindy Lee

    Cindy Lee Guest

    I'm using vs 2005 and .net 2.0 with the new login feature. I'm deploying to
    a remote website and using sql server 2005.

    I used aspnet_regsql to set this up on the remote sql server 2005 database.

    Everything works great when I deploy the website to the main directory of my
    server. But I want to put it in a differenet directory, say 'lofts/'
    The web site loads up fine, but when I try to log in, it can't find my
    username/pasword and registration doesn't work.

    Is there something in my web.config file i need to change?
     
    Cindy Lee, Mar 8, 2006
    #1
    1. Advertising

  2. Cindy Lee

    Cindy Lee Guest

    Oh, my config file is:

    <connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data
    Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    Info=True;User ID=xxx;Password=xxx"/>
    <add name="Personal" connectionString="Data
    Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    Info=True;User ID=xxx;Password=xxx"
    providerName="System.Data.SqlClient" />
    <add name="loftladbConnectionString1" connectionString="Data
    Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    Info=True;User ID=xxx;Password=xxx"
    providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>
    <pages styleSheetTheme="White"/>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
    <membership defaultProvider="YourSqlProvider">
    <providers>
    <add connectionStringName="LocalSqlServer"
    minRequiredPasswordLength="6"
    minRequiredNonalphanumericCharacters="0" name="YourSqlProvider"
    type="System.Web.Security.SqlMembershipProvider" />
    </providers>
    </membership>
    <authentication mode="Forms">
    <forms loginUrl="default1.aspx" protection="Validation" timeout="300"
    />
    </authentication>
    <authorization>
    <allow users="*"/>
    </authorization>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider" />
    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    <providers>
    <add name="XmlSiteMapProvider" description="SiteMap provider which reads
    in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web,
    Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxx"
    siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
    </providers>
    </siteMap>
    </system.web>
    <location path="Admin">
    <system.web>
    <authorization>
    <allow roles="Administrators"/>
    <deny users="*"/>
    </authorization>
    </system.web>
    </location>
    </configuration>

    "Cindy Lee" <> wrote in message
    news:...
    > I'm using vs 2005 and .net 2.0 with the new login feature. I'm deploying

    to
    > a remote website and using sql server 2005.
    >
    > I used aspnet_regsql to set this up on the remote sql server 2005

    database.
    >
    > Everything works great when I deploy the website to the main directory of

    my
    > server. But I want to put it in a differenet directory, say 'lofts/'
    > The web site loads up fine, but when I try to log in, it can't find my
    > username/pasword and registration doesn't work.
    >
    > Is there something in my web.config file i need to change?
    >
    >
     
    Cindy Lee, Mar 8, 2006
    #2
    1. Advertising

  3. Cindy Lee

    Cindy Lee Guest

    also, is it possible to have 2 applications using the same database for
    usernames and passwords?

    "Cindy Lee" <> wrote in message
    news:...
    > Oh, my config file is:
    >
    > <connectionStrings>
    > <remove name="LocalSqlServer"/>
    > <add name="LocalSqlServer" connectionString="Data
    > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > Info=True;User ID=xxx;Password=xxx"/>
    > <add name="Personal" connectionString="Data
    > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > Info=True;User ID=xxx;Password=xxx"
    > providerName="System.Data.SqlClient" />
    > <add name="loftladbConnectionString1" connectionString="Data
    > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > Info=True;User ID=xxx;Password=xxx"
    > providerName="System.Data.SqlClient" />
    > </connectionStrings>
    > <system.web>
    > <pages styleSheetTheme="White"/>
    > <customErrors mode="Off"/>
    > <compilation debug="true"/>
    > <membership defaultProvider="YourSqlProvider">
    > <providers>
    > <add connectionStringName="LocalSqlServer"
    > minRequiredPasswordLength="6"
    > minRequiredNonalphanumericCharacters="0"

    name="YourSqlProvider"
    > type="System.Web.Security.SqlMembershipProvider" />
    > </providers>
    > </membership>
    > <authentication mode="Forms">
    > <forms loginUrl="default1.aspx" protection="Validation"

    timeout="300"
    > />
    > </authentication>
    > <authorization>
    > <allow users="*"/>
    > </authorization>
    > <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    > <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider" />
    > <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    > <providers>
    > <add name="XmlSiteMapProvider" description="SiteMap provider which

    reads
    > in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web,
    > Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxx"
    > siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
    > </providers>
    > </siteMap>
    > </system.web>
    > <location path="Admin">
    > <system.web>
    > <authorization>
    > <allow roles="Administrators"/>
    > <deny users="*"/>
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    >
    > "Cindy Lee" <> wrote in message
    > news:...
    > > I'm using vs 2005 and .net 2.0 with the new login feature. I'm

    deploying
    > to
    > > a remote website and using sql server 2005.
    > >
    > > I used aspnet_regsql to set this up on the remote sql server 2005

    > database.
    > >
    > > Everything works great when I deploy the website to the main directory

    of
    > my
    > > server. But I want to put it in a differenet directory, say 'lofts/'
    > > The web site loads up fine, but when I try to log in, it can't find my
    > > username/pasword and registration doesn't work.
    > >
    > > Is there something in my web.config file i need to change?
    > >
    > >

    >
    >
     
    Cindy Lee, Mar 8, 2006
    #3
  4. Cindy Lee

    Cindy Lee Guest

    Well I guess no on answered by question. But i figured it out, and you use
    the appliation name.

    <membership defaultProvider="YourSqlProvider">
    <providers>
    <add connectionStringName="LocalSqlServer" applicationName="TestApp"
    minRequiredPasswordLength="6"
    minRequiredNonalphanumericCharacters="0" name="YourSqlProvider"
    type="System.Web.Security.SqlMembershipProvider" />
    </providers

    From this article:
    http://odetocode.com/Articles/427.aspx

    Another important property to set in the membership configuration is the
    applicationName property. The applicationName allows one database to support
    multiple web applications. If you have two web applications and want both
    apps to share the same user base, give both applications the same
    applicationName and point them to the same aspnetdb database. If you want
    both applications to use the same database but not share users, give each
    application a unique applicationName property.





    "Cindy Lee" <> wrote in message
    news:%23SUP%...
    > also, is it possible to have 2 applications using the same database for
    > usernames and passwords?
    >
    > "Cindy Lee" <> wrote in message
    > news:...
    > > Oh, my config file is:
    > >
    > > <connectionStrings>
    > > <remove name="LocalSqlServer"/>
    > > <add name="LocalSqlServer" connectionString="Data
    > > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > > Info=True;User ID=xxx;Password=xxx"/>
    > > <add name="Personal" connectionString="Data
    > > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > > Info=True;User ID=xxx;Password=xxx"
    > > providerName="System.Data.SqlClient" />
    > > <add name="loftladbConnectionString1" connectionString="Data
    > > Source=SQLB1.webcontrolcenter.com;Initial Catalog=db;Persist Security
    > > Info=True;User ID=xxx;Password=xxx"
    > > providerName="System.Data.SqlClient" />
    > > </connectionStrings>
    > > <system.web>
    > > <pages styleSheetTheme="White"/>
    > > <customErrors mode="Off"/>
    > > <compilation debug="true"/>
    > > <membership defaultProvider="YourSqlProvider">
    > > <providers>
    > > <add connectionStringName="LocalSqlServer"
    > > minRequiredPasswordLength="6"
    > > minRequiredNonalphanumericCharacters="0"

    > name="YourSqlProvider"
    > > type="System.Web.Security.SqlMembershipProvider" />
    > > </providers>
    > > </membership>
    > > <authentication mode="Forms">
    > > <forms loginUrl="default1.aspx" protection="Validation"

    > timeout="300"
    > > />
    > > </authentication>
    > > <authorization>
    > > <allow users="*"/>
    > > </authorization>
    > > <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    > > <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider" />
    > > <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    > > <providers>
    > > <add name="XmlSiteMapProvider" description="SiteMap provider which

    > reads
    > > in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web,
    > > Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxx"
    > > siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
    > > </providers>
    > > </siteMap>
    > > </system.web>
    > > <location path="Admin">
    > > <system.web>
    > > <authorization>
    > > <allow roles="Administrators"/>
    > > <deny users="*"/>
    > > </authorization>
    > > </system.web>
    > > </location>
    > > </configuration>
    > >
    > > "Cindy Lee" <> wrote in message
    > > news:...
    > > > I'm using vs 2005 and .net 2.0 with the new login feature. I'm

    > deploying
    > > to
    > > > a remote website and using sql server 2005.
    > > >
    > > > I used aspnet_regsql to set this up on the remote sql server 2005

    > > database.
    > > >
    > > > Everything works great when I deploy the website to the main directory

    > of
    > > my
    > > > server. But I want to put it in a differenet directory, say 'lofts/'
    > > > The web site loads up fine, but when I try to log in, it can't find my
    > > > username/pasword and registration doesn't work.
    > > >
    > > > Is there something in my web.config file i need to change?
    > > >
    > > >

    > >
    > >

    >
    >
     
    Cindy Lee, Mar 9, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Finkel
    Replies:
    0
    Views:
    500
    Joel Finkel
    Sep 12, 2003
  2. Jeffry van de Vuurst
    Replies:
    2
    Views:
    545
    Jeffry van de Vuurst
    Jul 30, 2003
  3. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    833
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  4. Paul F
    Replies:
    4
    Views:
    644
    Mark Fitzpatrick
    Jun 25, 2008
  5. Adam Petrie
    Replies:
    8
    Views:
    322
    Adam Petrie
    Oct 11, 2004
Loading...

Share This Page