Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 March 30th, 2005, 12:09 PM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Working with Principal and Identity

hi
I was just fidling with Accouns code.I created a Login page using the approach shown in the page. the code for the logi button is as:

Code:
        private void Login_btn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            PhilePrincipal newUser = PhilePrincipal.ValidateLoginExample( UsernameBox.Text, PasswordBox.Text );
            if (newUser == null)
            {
                Label1.Text="problem";

            }
            else 
            {

                Context.User = newUser;
                FormsAuthentication.SetAuthCookie( UsernameBox.Text, true );        
                //Label1.Text="worked " + Context.User.Identity.Name;
                Response.Redirect("../../modules/products/loginexamplesuccess.aspx");
            }

        }


The problem I am facing is this:

If I display '...Identity.Name' in the current page (the login page), then the correct identity name is displayed. However, if I redirect the user to another page (as shown above) and check ( Context.User.Identity.IsAuthenticated ) then I get the user not to be authenticated.

Is there a different way I have to use Response.Redirect???

I have commented out:

// permissionList = dataUser.GetEffectivePermissionList( ((Business.SiteIdentity)identity).UserID );
// roleList = dataUser.GetUserRoles( ((Business.SiteIdentity)identity).UserID );

in the PhilePrincipal. That should not make a difference, should it??
thanks

 
Old March 31st, 2005, 05:09 AM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorted: had to change authentication mode to 'forms' in web.config






Similar Threads
Thread Thread Starter Forum Replies Last Post
@@IDENTITY use... neo_jakey Classic ASP Professional 1 May 3rd, 2008 06:47 AM
Wrong Principal Object Bob Bedell C# 2005 4 December 29th, 2007 09:52 AM
email confirmation and site principal identity seanmayhew BOOK: ASP.NET Website Programming Problem-Design-Solution 1 March 30th, 2005 09:10 AM
what does identity do amruthhr SQL Server 2000 2 January 6th, 2005 09:45 AM
Identity soccers_guy10 SQL Server 2000 3 September 2nd, 2003 07:05 AM





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