473,378 Members | 1,482 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,378 software developers and data experts.

Membership & Profile Question

I have this block of code below, but when ran it only creates the member it
doesnt fill in his profile data. Is there something I am missing? Please let
me know what I can do, just trying to progamatically create a member and fill
in his profile information. Thanks in advance.

protected void btnCreateuser_Click(object sender, EventArgs e)
{
// Store username for use
string strNewUsername = tbUserName.Text;

MembershipCreateStatus mcs = new MembershipCreateStatus();

// Create User Account
Membership.CreateUser(tbUserName.Text, tbPassword.Text,
tbEmail.Text, "What year was this application built?", "2006", true, out mcs);
Roles.AddUserToRole(strNewUsername, "user");
lblStatus.Text = mcs.ToString();

// Acces & fill new members profile with information
MembershipUser muNewUser = Membership.GetUser(strNewUsername);
ProfileCommon pcNewUser =
(ProfileCommon)ProfileBase.Create(muNewUser.UserNa me, true);
pcNewUser.Address1 = tbAddress.Text;
pcNewUser.Address2 = tbAddress2.Text;
pcNewUser.City = tbCity.Text;
pcNewUser.Name = tbName.Text;
pcNewUser.PhoneCell = tbCellPhone.Text;
pcNewUser.PhoneHome = tbHomePhone.Text;
pcNewUser.PhoneOffice = tbOfficePhone.Text;
pcNewUser.SponsorCode = Profile.UserName;
pcNewUser.SponsorCodeLevel2 = Profile.SponsorCode;
pcNewUser.State = tbState.Text;
pcNewUser.Zip = Int32.Parse(tbZip.Text);
}

--
Jesse Johnson
Jul 19 '06 #1
0 946

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

Similar topics

2
by: Amir Ghezelbash | last post by:
Hello all, I have a question..i am developing a web application in asp.net 2.0 and these past few days i have been reading about asp.net 2.0 Membership providers...now i have a question...i...
8
by: VB Programmer | last post by:
I would appreciate your assistance on this ASP.NET 2.0 site.... This is the wierd problem: While accessing the built in .NET functions for 'profiling' or 'membership' an error is generated (see...
2
by: Demetri | last post by:
I have several questions regarding the Membership and Roles mechanism in ASP.Net 2.0. 1. In the box, it comes with SqlMembershipProvider, which uses SQL Express 2005. What if I want it to use...
0
by: Anonieko | last post by:
A lot of times, web hostings for ASPNET 2.0 will offer only MS Access DB for database for basic plan, a question often asked is how can I use the membership services, role, web parts services, etc ...
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...
0
by: =?Utf-8?B?QV9SZXB1YmxpY2Fu?= | last post by:
This is a portion of my Web.config file: <system.web> <membership defaultProvider="SqlProvider"> <providers> <clear/> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider"...
2
by: Nightcrawler | last post by:
I recently started to use MemberShip, Roles, and User to build a portal site in asp.net 2.0. I currently have set the web.config to only store registered users in the database. I don't want to...
4
by: vincent90152900 | last post by:
How to remove Security Question and Security Answer from membership provider? Following is my codes. Please tell me how to remove Question and Answer from membership provider. Thank you for...
1
by: =?Utf-8?B?aGZkZXY=?= | last post by:
Hello, I have a web application that makes use of the SQL Membership and Role providers. My app has admin screens to manage users (membership), roles, and supplementary user data. I have just...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.