473,385 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Profile not saving

Hello,

I am using asp.net20 membership. I have some properties in
web.config

<properties>
<add name="FirstName" type="System.String" allowAnonymous="true"/>
<add name="LastName" type="System.String" allowAnonymous="true"/>
<add name="JobTitle" type="System.String" allowAnonymous="true"/>

<properties>

in my update profile code i have

ProfileCommon pc =
(ProfileCommon)System.Web.Profile.ProfileBase.Crea te(Membership.GetUser().Email,
true);
pc.FirstName = MemberFirstName;
pc.LastName = MemberLastName;
pc.JobTitle = MemberJobTitle;
pc.Save();

I dont get any errors and nothing gets saved. When the member first
registers and enters these profile fields they are captured and saved
however when user later tries to update they cannot.

Anyone any ideas.

Thanks in advance.

Ismail

Mar 7 '07 #1
4 2149
On Mar 7, 5:08 pm, "Ismail" <ismail.ma...@iassmarts.comwrote:
Hello,

I am using asp.net20 membership. I have some properties in
web.config

<properties>
<add name="FirstName" type="System.String" allowAnonymous="true"/>
<add name="LastName" type="System.String" allowAnonymous="true"/>
<add name="JobTitle" type="System.String" allowAnonymous="true"/>

<properties>

in my update profile code i have

ProfileCommon pc =
(ProfileCommon)System.Web.Profile.ProfileBase.Crea te(Membership.GetUser().Email,
true);
pc.FirstName = MemberFirstName;
pc.LastName = MemberLastName;
pc.JobTitle = MemberJobTitle;
pc.Save();

I dont get any errors and nothing gets saved. When the member first
registers and enters these profile fields they are captured and saved
however when user later tries to update they cannot.

Anyone any ideas.

Thanks in advance.

Ismail
If I am not wrong, you should authenticate the user first.

Cheers,
Miguel

Mar 7 '07 #2
Unless the email is also the user name, or you are using a custom profile
provider, you are not pulling up the user. You can test this in debug by
setting a breakpoint here:
>pc.FirstName = MemberFirstName;
See if you have an object that is filled with your user.

The signature for Create is UserName, not email, so check this.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Ismail" <is**********@iassmarts.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
Hello,

I am using asp.net20 membership. I have some properties in
web.config

<properties>
<add name="FirstName" type="System.String" allowAnonymous="true"/>
<add name="LastName" type="System.String" allowAnonymous="true"/>
<add name="JobTitle" type="System.String" allowAnonymous="true"/>

<properties>

in my update profile code i have

ProfileCommon pc =
(ProfileCommon)System.Web.Profile.ProfileBase.Crea te(Membership.GetUser().Email,
true);
pc.FirstName = MemberFirstName;
pc.LastName = MemberLastName;
pc.JobTitle = MemberJobTitle;
pc.Save();

I dont get any errors and nothing gets saved. When the member first
registers and enters these profile fields they are captured and saved
however when user later tries to update they cannot.

Anyone any ideas.

Thanks in advance.

Ismail
Mar 7 '07 #3
Guys thanks for the replies,

Miguel the user is authenticated becuase you cannot get to this code
unless logged in and authenticated. Greg, The email is not the user
name but the user that I am pulling up is the correct user I can see
this from the name and last name and email properties. In the
web.config I have automaticSaveEnabled="false" does that need to be
true?

Regards

Ismail

Mar 7 '07 #4
Greg,

I am an idiot!! You were on the right track I just changed the email
to username and all works.

Many thanks for this.

Regards

Ismail

Mar 7 '07 #5

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

Similar topics

0
by: Miguel Dias Moura | last post by:
Hello, I am working on an Asp.Net 2.0 / SQL 2005 web site. I am using profile to save the users info on the database. For example, I have the following structure: Public Structure Name...
0
by: Miguel Dias Moura | last post by:
Hello, I am saving a complex type in Asp.Net 2.0 profile. I am using an SQL 2005 database as a profile provider. I have been consulting MSDN as help to create my class. (Please, see my code...
0
by: Miguel Dias Moura | last post by:
Hello, I am saving information about each user in Asp.Net 2.0 profile a using complex type, i.e., a class. I am using a SQL 2005 database as the profile provider. I am also saving the...
1
by: sonic | last post by:
so, profile provider is a way to save application preferenes for each user. the profile can be replaced to provide a different persistance layer, and/or schema, but what about tweaking it to work...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
2
by: jdp | last post by:
I've created a custom login control with values that are not used in the Membership table. I created these other fields through the <profiletag in the web config. I'm able to get a new member...
6
by: shapper | last post by:
Hello, What is the profiler provider type when using a Microsoft Access database? Thanks, Miguel
3
by: daokfella | last post by:
I want to be able to store profile information for a user when they sign up for an account...but BEFORE they can log in. Can this be done using any of the built-in profile methods? Here's my...
2
MattFitzgerald
by: MattFitzgerald | last post by:
Hi hope some one can help I have 2 questions:- Question 1) When saving a file in access to excel how do I specify current date Question2) When saving a file in access to excel how do I specify...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.