.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 31st, 2013, 09:52 PM
raniele3050 raniele3050 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 h 30 m 48 sec
Reputation Power: 0
This Property Cannot Be Set For Anonymous Users.

I'm starting to learn c# and asp.net, because I want to start a career around it. I know it's ambitious, however I really want it. I've tried fixing it by myself, debugging (?) and googling for answers.

Here is the cs file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ProfileObject : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Profile.Preferences.Theme = "Retro";
this.LiteralTheme.Text = Profile.Preferences.Theme;
}
}


The aspx file:

<%@ Page Language="C#" Debug="true" AutoEventWireup="true" CodeFile="ProfileObject.aspx.cs" Inherits="ProfileObject" %>

<!DOCTYPE html>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<h1> Profile object </h1>
Your selected theme:
<asp:Literal ID="LiteralTheme" runat="server"></asp:Literal>

</div>
</form>
</body>
</html>


The error is:
Server Error in '/' Application.
This property cannot be set for anonymous users.
Exception Details: System.Configuration.Provider.ProviderException: This property cannot be set for anonymous users.


Hmm the problem is that I cannot make it work. It's supposed to show the profile object on the web browser. Googling it tells me I need to set the database first. However I haven't set up any mysql or anything of the sort rather, I just want to learn about profile objects.

Reply With Quote
  #2  
Old January 31st, 2013, 11:28 PM
raniele3050 raniele3050 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level)raniele3050 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 h 30 m 48 sec
Reputation Power: 0
Hey. Someone assisted me with this problem. Am just putting around his answer and my answer just in case if people get a similar problem.

You need to setup a place to store the profile objects. Without a database, it can't really be persistent as a profile. The error you are getting though, is to say that the property Theme cannot be set for anonymous users. An anonymous user is anyone who isn't logged in and authenticated. You can easily make the Theme property anonymous by tweaking the definition in the web.config file like so:
<add name="Theme" allowAnonymous="true" />
Comments on this post
MBirchmeier agrees: Thank you for following up on your own post

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > This Property Cannot Be Set For Anonymous Users.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap