Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 4th, 2006, 06:23 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default CMS Login problem

Hi All,

Just got the ASP.NET 2.0 instant results book today. I started with the CMS and it installed and ran first time. The only problem is that I cannot login. I noticed in the database that there is two Administrator accounts, this seems a little odd. Next I tried adding an new aacount via the config tool. I was able to add the account but again was unable to login from the site.

Any ideas/fixes are eagerly awaited!

Danny
  #2 (permalink)  
Old April 4th, 2006, 12:52 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Danny,

Whoops, looks like something went wrong with the database. If you look in the aspnet_Applications tables, you'll see two applications: One called / and one called /Cms

The Administrator account (the user) is connected to both applications. However, there is only one MembershipUser connected to an application. In the aspnet_Roles table, there is only one role, connected to a different app than the MembershipUser is. Hence, the user account you use is not assigned to the Administrator role, so you can't log in successfully (to be exact, you do log in, because the Administrator account is a valid account; however, because you're not in the Administrator role, you cannot access the Management folder).

Fortunately, the fix is easy:

1. Start the ASP.NET Configuration tool (choose Website | ASP.NET Configuration)

2. Click the Security tab

3. Click Create or Manage roles

4. Under "Create New Role", enter Administrator (singular form) and click Add Role

5. For the new role, click Manage

6. In the Find User search box, type administrator and hit Find User.

7. Check the box for User Is Un Role for the Administrator role

8. Next, close the admin tool and start your site again. You should now be able to successfully log in.

Hope this helps, and if not, let me know.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old April 5th, 2006, 05:49 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for your reply but it doesnt work :(. The 'Administrator' role already exists and clearly it wont let me create another role with the same name. Also the users (Administrator and another one I added) are both associated with that role.

Danny
  #4 (permalink)  
Old April 5th, 2006, 12:55 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Danny,

Did you change anything other than the user account? And are you using the source based version, or did you install the site under IIS?

For the answer I gave you yesterday, I used the downloadable code, and then opened the Source folder directly from within Visual Web Developer.

If you installed the site under IIS, there's a fair chance you have an application called /Cms which is used for security and membership. In that case, you may need to add an applicationName attribute to the web.config on the Role Provider with the same name as the MembershipProvider (the default is /)

If that all fails, can you retry with the original source, open the source code directly and follow the steps from my previous post?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #5 (permalink)  
Old April 7th, 2006, 05:55 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I am having similar difficulties and none of the above work. After either IIS or source opening in Web Dev 2005. With the latter once built in the IDE it does not even get to login page just get a server error not recognising my DESKTOP/ASP account.

?? Help!

Russ

  #6 (permalink)  
Old April 7th, 2006, 06:14 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Russ,

What do you see when you open the Admin tool? Do you see a user account and a role?

And can you elaborate on this:
Quote:
quote:page just get a server error not recognising my DESKTOP/ASP account
Can you specify the error you get?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #7 (permalink)  
Old April 9th, 2006, 02:22 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the error once I had built source in IDE. I also had an administrator role defined so am not sure how to proceed here.

Thanks

Russ

Server Error in '/Cms' Application.
--------------------------------------------------------------------------------

Cannot open user default database. Login failed.
Login failed for user 'DESKTOP\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'DESKTOP\ASPNET'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Cannot open user default database. Login failed.
Login failed for user 'DESKTOP\ASPNET'.]
   System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +735043
   System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
   System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
   System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
   System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +496
   System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1770
   System.Web.UI.WebControls.Repeater.GetData() +50
   System.Web.UI.WebControls.Repeater.CreateControlHi erarchy(Boolean useDataSource) +232
   System.Web.UI.WebControls.Repeater.OnDataBinding(E ventArgs e) +53
   System.Web.UI.WebControls.Repeater.DataBind() +72
   System.Web.UI.WebControls.Repeater.EnsureDataBound () +55
   System.Web.UI.WebControls.Repeater.OnPreRender(Eve ntArgs e) +12
   System.Web.UI.Control.PreRenderRecursiveInternal() +77
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

  #8 (permalink)  
Old April 9th, 2006, 02:24 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Probably also worth saying that logging into the other projects is also the same.

Russ

  #9 (permalink)  
Old April 9th, 2006, 03:14 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Russ,

Are you using SQL Server Express or a different version SQL Server? And did you modify the connection string used in the application?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #10 (permalink)  
Old April 10th, 2006, 03:50 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I am able to access the Admin tool, add accounts and roles etc. I have tried with the default clean setup with no modifications but am unable to login. I have also tried to resolve the problem in varous ways but have to date been unsuccessful.

Note to Russ: If you want to see what the admin pages look like you can remove the access security on those folders to enable annonymouse viewing. This clearly doesnt solve the problem but may help you see what the code is doing.

Danny
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CMS problem trieuanhl BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 November 23rd, 2008 05:38 AM
JavaScript Problem in CMS sankar2chat Javascript 0 August 19th, 2008 10:39 PM
CMS - admin login does not work peppie BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 October 20th, 2007 08:46 AM
CMS Envelope problem chapter 9 luke.koziol BOOK: Beginning Cryptography with Java 1 May 6th, 2007 05:15 PM
CMS-Cant Login SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 42 August 10th, 2006 03:23 PM



All times are GMT -4. The time now is 03:07 AM.


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