473,396 Members | 2,013 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,396 software developers and data experts.

Best Approach for Membership / Profile Information

jdp
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 created
my calling membership.create user and get the other fields saved by
creating an instance of ProfileBase, calling
SetPropertyValue("property",value) mulitple times for each property,
and finally calling the Save method. My first question is: is this the
correct approach or is there a better way of creating members and
saving the corresponding data?

Secondly, my site utilizes a master/detail scheme and when the user
logs in, I want to display their name on my master page. I created a
label on the master page and in it's Page_PreRender event, I assign the
text property the Profile.FirstName and Profile.LastName. So far, so
good. All of my detail pages inherit from a 'base' page and I have
logic in the Page_Load event to check the User.Identity.Name and if
found, display the LoginStatus control. However, since Profile is not
available here, this explains why I placed the logic in the master
page. Is this the correct approach? Is there a better way?

Any feedback is greatly appreciated!

Thanks in advance.

Aug 14 '06 #1
2 1379

"jdp" <ja***********@pacourts.uswrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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 created
my calling membership.create user and get the other fields saved by
creating an instance of ProfileBase, calling
SetPropertyValue("property",value) mulitple times for each property,
and finally calling the Save method. My first question is: is this the
correct approach or is there a better way of creating members and
saving the corresponding data?
The "most correct" method would be inherit from the membership classes and
create the extra fields. Then, edit the ASPNET_ database tables with the
info you want. I am currently in the works on this same idea, but do not
have a working example. I will blog when I do:

http://spaces.live.com/gregorybeamer

Otherwise, your method works, even though it requires a few more trips.
Secondly, my site utilizes a master/detail scheme and when the user
logs in, I want to display their name on my master page. I created a
label on the master page and in it's Page_PreRender event, I assign the
text property the Profile.FirstName and Profile.LastName. So far, so
good. All of my detail pages inherit from a 'base' page and I have
logic in the Page_Load event to check the User.Identity.Name and if
found, display the LoginStatus control. However, since Profile is not
available here, this explains why I placed the logic in the master
page. Is this the correct approach? Is there a better way?

I am a bit confused on this one.

Assigning from profile is okay, but I am not sure about the login status
control. Is it not on the master page? If not, why not?

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

*************************************************
Think Outside the Box!
*************************************************
Aug 15 '06 #2
jdp
Thanks for the reply.

The controls are indeed on the master page. However, the User.Identity
object does not appear to be available on the masterpage when I try and
check to see if values exist. In my 'base' page, the Profile object
does not exist to get my custom fields. So now I have logic in
master_PreRender to check the profile and logic in base.Page_Load to
check User.Identity
Secondly, my site utilizes a master/detail scheme and when the user
logs in, I want to display their name on my master page. I created a
label on the master page and in it's Page_PreRender event, I assign the
text property the Profile.FirstName and Profile.LastName. So far, so
good. All of my detail pages inherit from a 'base' page and I have
logic in the Page_Load event to check the User.Identity.Name and if
found, display the LoginStatus control. However, since Profile is not
available here, this explains why I placed the logic in the master
page. Is this the correct approach? Is there a better way?


I am a bit confused on this one.

Assigning from profile is okay, but I am not sure about the login status
control. Is it not on the master page? If not, why not?

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

*************************************************
Think Outside the Box!
*************************************************
Aug 15 '06 #3

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

Similar topics

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...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
0
by: Jesse Johnson | last post by:
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...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
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...
6
by: Magdoll | last post by:
Hi, I know this is potentially off-topic, but because python is the language I'm most comfortable with and I've previously had experiences with plone, I'd as much advice as possible on this. I...
1
by: Jeff | last post by:
Hey asp.net 2.0 at work we are about to start on a new project. Creating a website. My mananger has created the database. The database has a table holding user information (not that standard...
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...
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...
0
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...
0
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...
0
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...
0
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...
0
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,...

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.