473,657 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Profile. Going Crazy. Please, help me out.

Hello,

On my CMS I am signed as administrator and I am creating a Membership
user and its profile:

MembershipCreat eStatus status;
MembershipUser user = Membership.Crea teUser("Joe", "Pass",
"Jo*@email.com" , null, null, true, null, out status);
if (user != null) {
ProfileHelper profile =
ProfileHelper.G etProfile(user. UserName);
// Define profile properties values here
profile.Save();
}

ProfileHelper is a custom profile provider that has two properties:
Colaborator and Visitor.

When creating the profile I keep getting the error:
System.Configur ation.Provider. ProviderExcepti on: This property cannot
be set for anonymous users.

But I am creating another user and I am signed with my account. I am
on this for hours and can't solve this!

Could someone, please, help me? Here is my profile provider:

public class ProfileHelper : ProfileBase {
[SettingsAllowAn onymous(false),
SettingsSeriali zeAs(SettingsSe rializeAs.Binar y)]
public Profile.Collabo rator Collaborator {
get {
return base["Collaborat or"] as Profile.Collabo rator;
}
set {
base["Collaborat or"] = value;
}
} // Collaborator
[SettingsAllowAn onymous(true),
SettingsSeriali zeAs(SettingsSe rializeAs.Binar y)]
public Profile.Visitor Visitor {
get {
return base["Visitor"] as Profile.Visitor ;
}
set {
base["Visitor"] = value;
}
} // Visitor

// GetProfile
public static ProfileHelper GetProfile() {
return Create(System.W eb.Security.Mem bership.GetUser ().UserName)
as ProfileHelper;
} // GetProfile

// GetProfile
public static ProfileHelper GetProfile(stri ng username) {
return Create(username ) as ProfileHelper;
} // GetProfile
}

Thanks,

Miguel

Oct 31 '08 #1
1 2662
On Oct 31, 11:46*pm, shapper <mdmo...@gmail. comwrote:
Hello,

On my CMS I am signed as administrator and I am creating a Membership
user and its profile:

* * * MembershipCreat eStatus status;
* * * MembershipUser user = Membership.Crea teUser("Joe", "Pass",
"J...@email.com ", null, null, true, null, out status);
* * * if (user != null) {
* * * * ProfileHelper profile =
ProfileHelper.G etProfile(user. UserName);
* * * * // Define profile properties values here
* * * * profile.Save();
* * * }

ProfileHelper is a custom profile provider that has two properties:
Colaborator and Visitor.

When creating the profile I keep getting the error:
System.Configur ation.Provider. ProviderExcepti on: This property cannot
be set for anonymous users.

But I am creating another user and I am signed with my account. I am
on this for hours and can't solve this!

Could someone, please, help me? Here is my profile provider:

* public class ProfileHelper : ProfileBase {
* * [SettingsAllowAn onymous(false),
SettingsSeriali zeAs(SettingsSe rializeAs.Binar y)]
* * public Profile.Collabo rator Collaborator {
* * * get {
* * * * return base["Collaborat or"] as Profile.Collabo rator;
* * * }
* * * set {
* * * * base["Collaborat or"] = value;
* * * }
* * } // Collaborator
* * [SettingsAllowAn onymous(true),
SettingsSeriali zeAs(SettingsSe rializeAs.Binar y)]
* * public Profile.Visitor Visitor {
* * * get {
* * * * return base["Visitor"] as Profile.Visitor ;
* * * }
* * * set {
* * * * base["Visitor"] = value;
* * * }
* * } // Visitor

* * // GetProfile
* * public static ProfileHelper GetProfile() {
* * * return Create(System.W eb.Security.Mem bership.GetUser ().UserName)
as ProfileHelper;
* * } // GetProfile

* * // GetProfile
* * public static ProfileHelper GetProfile(stri ng username) {
* * * return Create(username ) as ProfileHelper;
* * } // GetProfile
* }

Thanks,

Miguel
Please, anyone?
Nov 3 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3101
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with Visual Studio.NET 2003. We have uninstalled and reinstalled the Product.... then we did a complete cleanout of development products, re-installed IIS, and reinstalled JUST Visual Studio.NET 2003 with Framework 1.1 (no more 2002 edition or...
2
1764
by: givlerj | last post by:
I need some help. Here is a little background, I support a MS Access 2k DB (SQL Server 2k backend) that has courses and students. The problem form lets the user pick a course from a drop down and opens a report of the students attending the course in the dropdown. A user can't view on 1 course in the dropdown list. He can view other courses but not this one. Other users on other computers can view the course just fine. Furthermore, I was...
0
848
by: Ron | last post by:
Hi, I need to store a string array in the profile properties. I belive this will work please correct me if wrong. It is only going to hold three items. Thanks, Ron
27
3774
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB updates the same data in all other four tables in the right places. I know it would be possible by using the ForeignKeyConstraint object. I have created the tables using the DataSet Visual Tool and I know it doesn't create any ForeignKeyConstraint obj....
1
1347
by: shapper | last post by:
Hello, I have a profile with multiple profile properties in my Web.Config: <add allowAnonymous="false" name="Contact" type="Contact" serializeAs="Binary"/> <add allowAnonymous="false" name="Options" type="Options" serializeAs="Binary"/> Where each profile property is class, as follows:
11
2088
by: Weston Weems | last post by:
I've got the need to have user information for logged in user in a readily avaliable page context (a lot like how Profile is) except not suck. Before we jump to any conclusions, from what I gathered, the implementation of the provider model is absolute garbage. While I've seen microsoft employees make other questionable design decisions, I cant possibly fathom why a user profile cant be derived as some other object.
2
5900
by: Brandon Holliday | last post by:
Hello, I have a problem that I need some help on. I am creating a website that utilizes the builtin membership functionality in Asp.net 2.0. By default, the "AspNetSqlProvider" is used and the membership data is stored in "AspNetDB.mdf". However, instead of using this mdf file, I would like to store the membership data in Sql Server, using the "SqlMembershipProvider". I have already run the "regsql.exe" file, but I'm not sure of...
4
2493
by: Scott M. | last post by:
When profile data is stored in ASP .NET, where is the user data persisted? For how long is it persisted: is it session persisted or permanent (like a cookie)?
6
8808
by: Mr. X. | last post by:
Hello. How can I create aspnetdb from scratch ? (I want a script that create all table, views, etc... on that database). Thanks :)
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.