Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 July 13th, 2006, 11:27 AM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default FileShare Login not working

I am attempting to set up the "fileshare" app to work with my SQL2000 db, and have sucessfully created the ASP management tables within the db for the fileshare application.
However, when I attempt to login the site via Login.aspx - it displays:

"Your login attempt was not successful. Please try again."

However, I am still able to perform a request for a my password, and it will send me a *new* password through the email for the user.
But when I try and use this password - it still denies me.

What am I missing here? I can see the "Admin" user I set up in the db in the aspnet_Membership table, and the email associated with it. So it must be getting my email address I assigned to the user from the db when I request a password through the Login.aspx page - so why is the password denied?

I have even attempted to copy the value for Password from the aspnet_Membership table and paste it into the Passwork text box on the Login.aspx page - but this does not work either?

Any help here would be greatly appreciated!

-b
 
Old July 14th, 2006, 07:53 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Did you also create the necessary accounts and roles through the Website Administration Tool?

It may be that your account exists, but that it isn't assigned to the proper roles.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old July 17th, 2006, 02:04 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply -

Yes, I did create the accounts and roles and access privilages via the WAT - which I assume is how I am getting back the request for password correctly?
But it will not allow/process login?

I am not using the ASPNETMDF - instead it is writing to my SQL2000 db - and I can see the tables and new roles it has written to the db.

Let me know if you can think of more steps to find the flaw here.

Thanks,

b
 
Old July 18th, 2006, 03:59 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi again,

Did you create the SQL 2000 database with the aspnet_regsql tool?
And did you reconfigure the web.config file for your application to use this new database? How does your web.config file look like?

When you create an account through the WAT, does it end up in the correct database? What do you see when you look in the aspnet_Applications, aspnet_Users and aspnet_Membership tables of your new database?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old July 20th, 2006, 04:43 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply Imar - this is most likely where I am lost and thus the login will not work fully.

Quote:
quote:Did you create the SQL 2000 database with the aspnet_regsql tool?
Yes

I am going to paste my web.config here:
Code:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings>
  <add key="EmailFrom" value="admin@server.com" />
  <add key="EmailSubject" value="File Ready for Download!" />
  <add key="SmtpServer" value="mail.server.com" />
  <add key="MailUser" />
  <add key="MailPassword" />
  <add key="MailPort" value="25" />
  <add key="EmailFormatSelected" value="Text" />
  <add key="PageTitle" value="My File Share" />
  <add key="ShareLocalFolderPath" value="C:\inetpub\wwwroot\FileShare\FileStorage\" />
  <add key="httpDownloadPath" value="http://localhost/FileShare/" />
  <add key="CurrentTheme" value="CleanBlue"/>
  <add key="Fileshare" />
 </appSettings>
    <connectionStrings>
      <remove name="LocalSqlServer"/>
      <add name="ConnectionString_MyData" connectionString="Data Source=SQL2000Server; Database=MyData;Integrated Security=true" providerName="System.Data.SqlClient"/>
      <add name="LocalSqlServer" connectionString="Data Source=SQL2000Server;Database=FileShare;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>


    <roleManager enabled="true"/>
        <compilation debug="true" strict="false" explicit="true">

            <assemblies>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
        <pages>
            <namespaces>
                <clear/>
                <add namespace="System"/>
                <add namespace="System.Collections"/>
                <add namespace="System.Collections.Specialized"/>
                <add namespace="System.Configuration"/>
                <add namespace="System.Text"/>
                <add namespace="System.Text.RegularExpressions"/>
                <add namespace="System.Web"/>
                <add namespace="System.Web.Caching"/>
                <add namespace="System.Web.SessionState"/>
                <add namespace="System.Web.Security"/>
                <add namespace="System.Web.Profile"/>
                <add namespace="System.Web.UI"/>
                <add namespace="System.Web.UI.WebControls"/>
                <add namespace="System.Web.UI.WebControls.WebParts"/>
                <add namespace="System.Web.UI.HtmlControls"/>
            </namespaces>
        </pages>

    <authentication mode="Forms" />

    </system.web>

 <system.net>
  <mailSettings>
   <smtp from="noreply@server.com">
    <network host="mail.server.com" password="" userName="" />
   </smtp>
  </mailSettings>
 </system.net>
</configuration>
I am using the MyData db in order to pull back files to send to the enduser. And the FileShare db to store the user info and fileshare proc, tables etc..

 
Quote:
quote:When you create an account through the WAT, does it end up in the correct database?
Yes, it shows up in the FileShare db.

 
Quote:
quote:What do you see when you look in the aspnet_Applications, aspnet_Users and aspnet_Membership tables of your new database?
Quote:
aspnet_app has 1 row:
Code:
 
ApplicationName    LoweredApplicationName    ApplicationId    Description
/    /             {C06310B3-AA3A-4C52-8F43-36D9F01E5568}
aspnet_Users has 1 row:
Code:
ApplicationId    UserId    UserName    LoweredUserName    MobileAlias    IsAnonymous    LastActivityDate
{C06310B3-AA3A-4C52-8F43-36D9F01E5568}    {DA1C6C89-1BC3-483E-99BC-B1BAA656548B}    Admin    admin        0    7/13/2006 2:54:40 PM
aspnet_Membership has 1 row
Code:
ApplicationId    UserId    Password    PasswordFormat    PasswordSalt    MobilePIN    Email    LoweredEmail    PasswordQuestion    PasswordAnswer    IsApproved    IsLockedOut    CreateDate    LastLoginDate    LastPasswordChangedDate    LastLockoutDate    FailedPasswordAttemptCount    FailedPasswordAttemptWindowStart    FailedPasswordAnswerAttemptCount    FailedPasswordAnswerAttemptWindowStart    Comment
{C06310B3-AA3A-4C52-8F43-36D9F01E5568}    {DA1C6C89-1BC3-483E-99BC-B1BAA656548B}    kLXkvXqN+AUJY2iSV99DTFr8hRY=    1    VZvj5kCFC8YJIu2C701t8Q==        user@someserver.com    user@someserver.com    passwd_1    vsFCz2Etpt3nlI1kem7tZItCLYM=    1    0    7/13/2006 2:54:39 PM    7/13/2006 2:54:40 PM    7/13/2006 6:04:07 PM    1/1/1754    0    1/1/1754    0    1/1/1754
Well that is it, let me know if you need any other info here. If I were to guess, I think the issue could be coming from the web.config, because it appears as if the db data is lining up, but just not getting back on login?

Thank you very much for taking the time to look at this! - hopefully we will come to the bottom of this.

-b

 
Old July 21st, 2006, 04:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hmmm, not sure why this doesn't work for you. This is what I did to make it work:

1. Downloaded and extracted the code from the Wrox site.

2. Opened the site in VWD and replaced the web.config with the one you posted

3. Changed the LocalSqlServer connection string to point to my local instance of SQL Server 2000

4. Created a database called FileShare and ran aspnet_regsql to set up the database.

5. Deleted aspnetdb.mdf from the App_Data folder to make sure I was using the proper database.

6. From within VWD, ran the WAT. Created a role called Admin and a single user. Assigned that user to the Admin role.

7. From within VWD, pressed F5 to start the app. Browsed to ManageEmail.aspx in the Management folder. When asked to login, supplied the details for the account created in step 6.

Bingo. Instant access....

Doesn't this work for you? When you run the site, do you open it from with VWD, or do you have it running under IIS??

Imar
---------------------------------------
Imar Spaanjaars
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: Let Your Good Heart Lead You Home by Editors (Track 1 from the album: Cuttings) What's This?
 
Old July 22nd, 2006, 01:21 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I do see the site running in the IIS manager. But I am launching it via the F5 build in VS.
When launched the URL looks like http://localhost:PORT/FileShare/Login.aspx - which localhost:PORT is the ASP.NET Dev server.
If these settings appear to be accurate, I am going to have to start over again like you did with this and see if I can get this to work.

Thanks again for your help - let me know if you see any potential issues with the URL or site running in IIS.

-b

 
Old July 23rd, 2006, 05:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, if you installed the site with the supplied installer, you'll see it in IIS.

However, when you open the site through VWD using F5 or Ctrl+F5, you run it against the built-in web server which is unrelated to the site in IIS.

So, what you are describing is exactly how it should work, and is what I am seeing as well. There must be something else going wrong, so giving it a fresh retry might do the trick...

Good luck,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old July 24th, 2006, 04:02 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well - I started from the top. And it appears we may be getting a bit further...

Now on login is throws this exception @ line49 of Dal/EmailContent.vb

"Data is Null. This method or property cannot be called on Null values."

So it seems to not be getting the users email? Or is this the default for any exception raised?

Thanks,

b

 
Old July 25th, 2006, 07:48 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, you're correct.

This error indicates that you successfully logged in, but that there is a null value in the database somewhere that was not anticipated.

Did you create this database yourself? Or is this the one from the code download? Maybe when you scripted the 2005 database to its 2000 equivalent, you forgot to script the defaults for columns? Can you explain how you created the 2000 database?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config problem in FileShare trieuanhl BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 November 2nd, 2008 09:48 AM
FileShare chapter problems asptwodev BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 November 5th, 2007 11:06 AM
Error While logging to FileShare Application DeadZone BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 April 5th, 2007 02:28 PM
Problem with FileShare login ermutigen BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 July 15th, 2006 04:18 AM
FileShare Project Not Working shawn BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 April 26th, 2006 01:18 PM





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