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 27th, 2008, 03:27 PM
Registered User
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I am understanding more now.
On my local machine: http://localhost:3841/BugBase/

Deployed site: http://aspspider.info/pauljmullin/

You will have to excuse my ignorance as this is the first ASP.net site I have ever deployed. But how do i know if my account is linked to the right roles for the right application? Is that done using the web configuration tool?

What specifically am i looking for in the tables (and which tables?) Again, I am really trying hard to learn this and appreciate your help in learning. Not looking to be spoon fed.




 
Old February 27th, 2008, 03:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

See my earlier post. I listed a few tables that you need to check.

Easiest thing to do is look at the database schema first; this should help you understand the relation between the tables.

Then follow the wire: check your user account in aspnet_Users and aspnet_Membership. Look at the UserID and the ApplicationID it's linked to. Then look in aspnet_UsersInRoles and see to what roles your user account is linked. Then look into aspnet_Roles and see if the roles you are linked to in aspnet_UsersInRoles are linked to the same application as your account is.

Does that make any sense? It's a bit confusing as the ASP.NET infrastructure allows you to store multiple applications in the same system. The web.config (the Membership and RoleManager providers in particular) allows you to assign an applicationName which is the name you see in the aspnet_Applications table.

You could also clear out the entire aspnet_* tables, and recreate the relevant records using th WSAT.

As another alternative, you could temporarily hard code creation of roles and assignment of users in the Start event of the application in Global.asax. E.g. (untested):
Code:
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the application is started

        If Not Roles.RoleExists("Administrators") Then
            Roles.CreateRole("Administrators")
        End If

        If Membership.GetUser("YourUserName") Is Nothing Then
            Membership.CreateUser("YourUserName", "P4s$w0rd")
        End If

        If Not Roles.IsUserInRole("YourUserName", "Administrators") Then
            Roles.AddUserToRole("YourUserName", "Administrators")
        End If

    End Sub
You may need to repeat parts of this code for the other roles.

Hope this helps,

Imar
 
Old March 7th, 2008, 04: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

Hi Paul,

Did this resolve your issue?

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
IIS - Windows 2003 MAtkins Classic ASP Basics 18 April 27th, 2007 09:57 AM
roles and users in bugbase mrco BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 February 6th, 2007 12:32 PM
Problem Connecting to BugBase DB under IIS maxshreck BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 8th, 2006 07:48 PM
windows groups / roles evander General .NET 0 January 23rd, 2006 08:13 AM
IIS 2003 Can't Debug - Please HELP! MAtkins Classic ASP Basics 0 June 28th, 2005 09:04 PM





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