Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 October 30th, 2007, 08:27 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default This property can not be set for anonymous users

Guys,
I am getting this error once in a while : System.Configuration.Provider.ProviderException: This property cannot be set for anonymous users.

any help is appreciated

when user tries to log in, once user name and password is authenticated in database, I execute following code to set the profile

FormsAuthentication.SetAuthCookie(userName, false);
System.Security.Principal.GenericIdentity identity = new System.Security.Principal.GenericIdentity(userName );
        System.Security.Principal.GenericPrincipal user = new System.Security.Principal.GenericPrincipal(identit y, null);
        Context.User = user;
        SqlDataReader dr = myDB.GetUserInformation(userName);
        if (dr.Read())
        {
            Profile.FirstName = dr["FirstName"].ToString();
            Profile.LastName = dr["LastName"].ToString();
        }
        dr.Close();
 
Old October 30th, 2007, 08:28 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default

99% of the time, i don't get this error.
 
Old April 19th, 2008, 04:28 AM
Registered User
 
Join Date: Dec 2004
Location: jwize, jwize, Japan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jwize
Default

99 % of the time you are logged in.


Tsik Man




Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I set default theme for all users? gujju BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 18th, 2008 10:25 AM
Get Set Property value being lost asn187 ASP.NET 2.0 Professional 1 April 19th, 2007 03:09 PM
Set Listbox Selected property DaDeViL VB How-To 7 October 4th, 2006 04:04 PM
Set accountExpires property r_ganesh76 C# 0 August 9th, 2006 01:16 AM
Session not working for Anonymous users songsan General .NET 0 January 4th, 2005 02:57 PM





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