Something more advance... I think.

R

RickDee

Hi.
I am developing an application where I need to have employee id ( example
802233 ), employee name ( for example Alphonsus Teo ) and log on username
( for example abcxxx ). Understand that when we create a project in Visual
Web Developement, a whole complete set of databases will be there which
consists of username, password and etc. Now with Visual Web Development,
controls like login control, login view control, login status control and
etc are all provided. I can just drag and drop them and immediately username
can be created and user can log in happily.
Here comes my problem. I would like to tie username with employee id and
employee name. Questions are :
1. Which table(s) I need to add extra columns for employee id and employee
name? Seems like a few tables are heavily link together.
2. Even if I know which table(s) I should add the extra two columns, how
should I change those login view control, login control, password recovery
control, create user control so that when somebody register themselves on
the page, his employee id and name and login username will be captured
together?

Anybody has done the similar thing b4? Please help me.

Thanks
Regards
 
S

Steven Cheng[MSFT]

Hi RickDee,

Thanks for your posting. As for the problem you mentioned, based on my
research, the asp.net 2.0 's MemberShip Service ( the LoginView, ..
Controls or othe underlying component) are all based on the classes under
the System.Web.Security namespace. For example, a User is represented by a
MemberShipUser and creating , modifying user are controled by a Provider
class which deal with the underling database(sqlserver , access or ...).
Also, these classes can be customized by ourself through defining new
derived types from them or event create new ones. And here is a msdn
article discussing on this:

#Building Custom Providers for ASP.NET 2.0 Membership
http://msdn.microsoft.com/library/en-us/dnaspp/html/bucupro.asp?frame=true

Also, as for your scenario, you've some additional user profile fields to
add into the user's AccountProfiles, I think you may need to define a
complete new MemberShipUser class and a custom Service Provider
accordingly. Also, we may need to create our custom Login Controls to be
adpated to our custom classes. I'm afraid this will be a large task.

In addition, I think you may also have a look in the .NET Whidbey newsgroup
to see whethre there're any other members who has any experience on this.

#Welcome to the Microsoft Visual Studio 2005 Newsgroups
http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slcid=us

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
R

RickDee

Hi Steven Cheng,

ok. I will look into whatever that you are suggesting. It seems like there
is more work for me to do in order to meet what I wanted.

In the meantime, do you think you should feedback to Microsoft telling them
customer does ask for something like this ?

Thanks
Regards
 
S

Steven Cheng[MSFT]

Hi RickDee,

Thanks for your followup. Yes, I think the problem you mentioned does make
much sense. Though I'm not sure whether the final relase of the asp.net 2.0
will provide more flexible functions on this, I can consult some further
experts to see whether the 2.0 release will have this improved or address
this problem soon. I'll let you know as soon as I got any info. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi RickDee,

After some further consulting, it seems that we do need to do some more
works when customizing the asp.net2.0 's membership serivice so as to
adding some additional fields.

We can derive from MembershipUser and extend it as needed. In conjunction
with this we will need to either author a custom provider, or derive from
an existing provider and override methods that return back MembershipUser
instances. Note though that for Whidbey creating a new user with the extra
information is a bit awkward - we first need to call CreateUser (which is
not extensible). Once the base user is created, we can get the user (our
custom provider would override GetUser to return our derived MembershipUser
instance), update the additional properties we added, and then save the
data back by calling UpdateUser (our custom provider would override
UpdateUser as well).

#one thing awkward is that the "CreateUser" method's signature is hard
coded which isn't extensible and we'll need to workaround it via override
the other method such as GetUser , UpdateUser later.

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top