Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2006, 12:54 PM
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yasminnnnn
Default login fails...

hey hey
a few days ago once i established a database connection, app_data folder was created and my users were not able to login the site anymore. i realized that i had to give permissions to access app_data folder.and it worked..

but i face the same problem again. i placed the user and role tables of aspnetdb into my own database. now i have one integrated database. however, after i tried to make a database connection, it created the app_code folder and now all of my login attempts fail again..:(

i tried to give permissions to app_code folder. but it does not seem to solve the problem..

any idea?

 
Old December 11th, 2006, 05:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Didn't we do this here?? http://p2p.wrox.com/topic.asp?TOPIC_ID=53278

Has anything changed since that thread or is this a different issue?

Is your users database no longer in the App_Code folder? If not, where is it now? Did you change the web.config file?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Nothing Else Matters by Metallica (Track 8 from the album: Metallica) What's This?
 
Old December 12th, 2006, 05:31 AM
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yasminnnnn
Default

hello Imar
my users were previously in aspnetdb.mdf in the app_data folder. however i changed the default database of users via aspnet_regsql.exe. now i have my own database having my own tables and also the user tables. i can not place the database under app_data folder, the data source seems to be sql express (however i use sql server 2000). web config has those related lines now:

<connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=dernek;Integrated Security=True"
      providerName="System.Data.SqlClient" />
    <add name="dernekConnectionString" connectionString="Data Source=nesli;Initial Catalog=dernek;Persist Security Info=True;User ID=sa;Password=neya123"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
.................................................. .................

last nigth, we deleted all users and roles from our database manually and regenerated them. now login works again. i did not change anything else. i am very new to asp.net 2.0 that is why i ask many questions, so i beg your pardon:) thanks...

 
Old December 12th, 2006, 06:25 AM
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yasminnnnn
Default

sorry to take your time but is this problem about login always going to happen like that?

moreover, login control appears on our master page and its visibility is not set to false when loggen in. although we set its visiblewhenloggenin property to false.any idea?

thanks..

 
Old December 12th, 2006, 01:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, it shouldn't.

However, take a look at the aspnet_Applications table in the database. Do you see multiple records? Maybe you moved your site and .NET created a new application? When that happens, your existing users are mapped to the old application while your new site is mapped to the new application. This means users can no longer log in with the old accounts.
Under normal conditions, this never changes automatically.

Regarding the other issue: post some code. Show us the web.config and the code you use to display / hide your controls.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 12th, 2006, 02:25 PM
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yasminnnnn
Default

that is what my web.config file looks like:
.................................................. .................

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
 <appSettings>
  <add key="AMS" value="AMS" />
 </appSettings>

  <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=dernek;Integrated Security=True"
      providerName="System.Data.SqlClient" />
    <add name="dernekConnectionString" connectionString="Data Source=nesli;Initial Catalog=dernek;Persist Security Info=True;User ID=sa;Password=neya123"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
          <compilation debug="true"/>
        <authentication mode="Forms">
      <forms loginUrl="Default.aspx" protection="All"
                    timeout="30"
                    path="/"
                    requireSSL="false"
                    slidingExpiration="true"
                    defaultUrl="Default.aspx"
                    cookieless="UseDeviceProfile"
                    enableCrossAppRedirects="false"></forms>
    </authentication>

    <roleManager enabled="true"
                 cacheRolesInCookie="true"
                    defaultProvider="QuickStartRoleManagerSqlProvider"
                    cookieName=".ASPXROLES"
                    cookiePath="/"
                    cookieTimeout="30"
                    cookieRequireSSL="false"
                    cookieSlidingExpiration="true"
                    createPersistentCookie="false"
                    cookieProtection="All">
      <providers>
        <add name="QuickStartRoleManagerSqlProvider"
            type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="LocalSqlServer"
            applicationName="/"/>
      </providers>
    </roleManager>


    <membership defaultProvider="QuickStartMembershipSqlProvider" userIsOnlineTimeWindow="15">
      <providers>
        <add
            name="QuickStartMembershipSqlProvider"
            type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="LocalSqlServer"
            enablePasswordRetrieval="false"
            enablePasswordReset="true"
            requiresQuestionAndAnswer="true"
            applicationName="/"
            requiresUniqueEmail="true"
            passwordFormat="Hashed"/>
      </providers>
    </membership>


    <anonymousIdentification enabled="true"/>

    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
      <providers>
        <add name="XmlSiteMapProvider"
                    description="Default SiteMap provider."
                    type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    siteMapFile="Web.sitemap"
                    securityTrimmingEnabled="true"/>
      </providers>
    </siteMap>


      <profile enabled="true" >

        <properties>
        <add name="UserName"/>
        <add name="Name"/>
        <add name="Surname"/>
        <add name="Address"/>
        <add name="City"/>
        <add name="County"/>
        <add name="PostCode"/>
        <add name="Country"/>
        <add name="Email"/>
        <add name="Associationid"/>
        </properties>
    </profile>
  </system.web>


</configuration>
.................................................. .................
and that is what the masterpage which includes the login control looks like (could the visibility problem be related to where the login control is located?)
.................................................. .................
 <asp:Login ID="login1" runat="server" CssClass="login"
                    TextLayout="TextOnTop"
                   HelpPageUrl="~/Help.aspx" HelpPageText="Help"
                    AccessKey="1" BackColor="White" ForeColor="#000000" Height="220px" RememberMeSet="True" PasswordRecoveryText="Forgot Your Password?" PasswordRecoveryUrl="~/PassRec.aspx" Width="153px" VisibleWhenLoggedIn="False">
                    <TitleTextStyle CssClass="title" />
                </asp:Login>
        &nbsp;
:................................................. .................
by the way, now login works all right..
thanks a lot for all..

 
Old December 12th, 2006, 03:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Normally, that's how it's supposed to work. The Login control is hidden when the current user is logged in. Maybe you're using it on pages where the user isn't logged in yet?

Then again, it seems that in your situation "thing just stop and start working" out of the blue, so maybe the Login control is hidden again as soon as I hit the Post New Reply button.... ;)

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
login fails after SqlServer Studio has been opened TomH VB Databases Basics 1 October 1st, 2006 04:44 PM
Login Control fails on server PeterX ASP.NET 2.0 Basics 0 July 25th, 2006 10:53 AM
.ASP login page fails offline, but works online ?? putte74 Classic ASP Basics 1 January 10th, 2006 07:21 PM
SQL Server error 4060 - Login fails Sksdb SQL Server 2000 0 January 18th, 2005 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.