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 February 1st, 2007, 05:16 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logging in as Administrator, no Admin role?

We uploaded the chapter 9 WebShop to our remote server.

When I log in as Administrator, it appears that I am not getting
the Admin role.

We have the folders and files with R/W/Exec permissions.
We used the ASP.Net config tool to add the Admin role and
linked the Admin user to that role.
This fixed the problem when testing on a local server but
it did not fix the problem remotely.

We get no Admin management capabilities or any links to
get into the Admin functions.

How to fix this on our remote server?

What can be wrong?

Thanks.

Mike

 
Old February 1st, 2007, 05: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

Hi there,

When you look into the remote database, what do you see in the aspnet+_Applications table?

And do you see users in aspnet_users and aspnet_membership who have Role records on the aspnet_Roles and aspnet_RolesForUsers table?

How did you get the database and data at the remote host?

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.
 
Old February 2nd, 2007, 02:49 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes we can see the tables on the database with SQL Server Management Studio Express; and when we use the “configuration tool” in the VWD 2005 express (after using the ASP.Net SQL Server setup wizard (asp.net_regsql.exe) to point to the remote db; we can add roles and users to the remote database and set the users to the roles we want them in.

The only problem with the config tool is that we can’t delete existing access rules for the site folders (i.e. The Management Folder); all the existing rules are grayed out and we can’t even delete them. We can create new rules for the new users and roles, but this is not fixing our problem (login works, but admin link never appears).

The remote server we are dealing with requires us to make a (.bak) file of the (.mdf) local db and email it to them, they then use it to populate the database we want them to on the remote 2005 SQL server. This is how we got the existing database up on the remote this time as well. The database name is different on the remote server and it is the full version of SQL 2005, not the express edition we work with locally.

We think the problem might have something to do with the code we found in the file App_Code/AppConfiguration.vb on line 29 (connection string) we changed that to the correct remote string, with and without the provider name added to the string but this didn’t fix the problem either. Not sure we changed that correctly because of the “” within a ”” confusion.

Our web.config file contains the this new connection string [<connectionStrings>
    <add name="WebShop" connectionString="server=8.8.246.27; Initial Catalog = ocorratestdb; User Id = robert; password = XXXXXXXXXXX;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>]

We are able to see the site with this sting, but just can’t get the admin section to open up for us after logging in with the administrator user name which we’ve already set in the administrator role with the config tool. (the new administrator role we had to create; the old one is grayed out.)

Hope this gives a better idea of our problem.

Also, the server where the database resides does not allow us into the app folder. Can you suggest a company where they would allow us more access to the server? They do not even allow us to place the database files on to the server, we have to send them a copy and then they put them on to the server, which is a royal pain.

Mike


 
Old February 2nd, 2007, 02:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What I meant was: what do you see *in* the tables?

You can use Sql Server Management Studio to look into the tables. You could clear them all, and then reconfigure your users.

Managing users in a remote database has always been problematic. You may want to take a look at this article for some ideas about doing this programmatically:

http://msdn2.microsoft.com/en-us/library/aa478958.aspx

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.
 
Old February 2nd, 2007, 04:30 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

>You can use Sql Server Management Studio to look into the tables. >You could clear them all, and then reconfigure your users.

Exactly how to clear the tables?

 
Old February 2nd, 2007, 04:34 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there an "easy" way to clear the tables? all the dependencies, etc???

 
Old February 2nd, 2007, 04:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can open the table in Management Studio, select all records and then delete them.

You can also run the following script:

DELETE FROM aspnet_WebEvent_Events
DELETE FROM aspnet_UsersInRoles
DELETE FROM aspnet_PersonalizationAllUsers
DELETE FROM aspnet_PersonalizationPerUser
DELETE FROM aspnet_Paths
DELETE FROM aspnet_Membership
DELETE FROM aspnet_Profile
DELETE FROM aspnet_Roles
DELETE FROM aspnet_Users
DELETE FROM aspnet_Applications

This deletes the items in the right order. If not, simply run it a second time....

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.
 
Old February 2nd, 2007, 05:05 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, ran the script and that cleared things out. All data was cleared.
Went into the config tool and created the Administrator, adding roles, users, etc. for the Administrator.

Tried to create an access rule and has three grayed out access rules??? Can not delete or do anythinng, since they are grayed out. Why grayed out? (becauase they are in the web.config file?)?

Tried to log i as Administrator, but never get the Administrator screens, etc...same a before.

Ideas?

 
Old February 2nd, 2007, 05:13 AM
Authorized User
 
Join Date: Feb 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,

Are you on Skype?
If so, we can chat or text you the connection string if you want to have a peek under the hood.

Mike

 
Old February 2nd, 2007, 05:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Nope, not on Skype where I am now.

You can e-mail me some stuff if you want to through my Profile page?

The rules are read-only because they're defined as <location> elements in the root web.config. The WSAT instead creates separate web.config files in each relevant folder.

You could just manually edit the relevant web.config file(s) and upload them to the server. There's no real need to use the WSAT for that.

Also, make sure all the providers in web.config have an application name. I don't think the role provider has one, so you'll need to add something like this:

applicationName="/"

to its configuration.

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
Administrator Password for Webshop mcarol44 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 11th, 2007 05:02 PM
Wrox File Share - Admin Role defunct b67 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 May 19th, 2007 10:42 PM
moderator role into the admin panel kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 October 6th, 2006 11:25 AM
Administrator webforms nabeelalkaff BOOK: ASP.NET Website Programming Problem-Design-Solution 2 September 10th, 2006 11:09 AM
SSIS - Built-In Logging / Custom Logging ivobecker23 SQL Server 2005 0 April 21st, 2006 05:41 AM





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