473,396 Members | 2,140 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.

Custom MembershipProvider

WB
Hi,

I am revamping my company's website using .Net 2.0 & C#. I would like to
implement my own custom membership provider to manage membership information
already stored in my existing SQL 2000 database.

Therefore, I need to create a class the inherits the MembershipProvider
abstract class from the System.Web.Security namespace. For instance, I need
to provide a method in this class for creating user as follows:

public override MembershipUser CreateUser(string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)

My question is, what if I have different user info fields in my database? I
don't want to use the password question and answer, but I need to store the
address, phone number of a new user. Do I just create a just dummy method
required for the implementation, and then another overload with the fields
that I need?
Thanks,
WB.
Nov 4 '05 #1
3 1954
For fields like address and phone number, I suggest you look at also
implementing a profile provider (it's not that much more work.) For
remembering profile type information, you will find that it's probably
easier than trying to shoe-horn in additional information on the user
object itself. For the password question/answer stuff -- you can feel
free to ignore the values if you dont intend to use them.

John


WB wrote:
Hi,

I am revamping my company's website using .Net 2.0 & C#. I would like to
implement my own custom membership provider to manage membership information
already stored in my existing SQL 2000 database.

Therefore, I need to create a class the inherits the MembershipProvider
abstract class from the System.Web.Security namespace. For instance, I need
to provide a method in this class for creating user as follows:

public override MembershipUser CreateUser(string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)

My question is, what if I have different user info fields in my database? I
don't want to use the password question and answer, but I need to store the
address, phone number of a new user. Do I just create a just dummy method
required for the implementation, and then another overload with the fields
that I need?
Thanks,
WB.

Nov 4 '05 #2
WB

Ok. I'll study more about that. Thank you for your advice.
"John Murray" wrote:
For fields like address and phone number, I suggest you look at also
implementing a profile provider (it's not that much more work.) For
remembering profile type information, you will find that it's probably
easier than trying to shoe-horn in additional information on the user
object itself. For the password question/answer stuff -- you can feel
free to ignore the values if you dont intend to use them.

John


WB wrote:
Hi,

I am revamping my company's website using .Net 2.0 & C#. I would like to
implement my own custom membership provider to manage membership information
already stored in my existing SQL 2000 database.

Therefore, I need to create a class the inherits the MembershipProvider
abstract class from the System.Web.Security namespace. For instance, I need
to provide a method in this class for creating user as follows:

public override MembershipUser CreateUser(string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)

My question is, what if I have different user info fields in my database? I
don't want to use the password question and answer, but I need to store the
address, phone number of a new user. Do I just create a just dummy method
required for the implementation, and then another overload with the fields
that I need?
Thanks,
WB.

Nov 5 '05 #3
WB
Thought I'd just share this insightful post which I came across.

http://forums.asp.net/1069268/ShowPost.aspx
"WB" wrote:

Ok. I'll study more about that. Thank you for your advice.
"John Murray" wrote:
For fields like address and phone number, I suggest you look at also
implementing a profile provider (it's not that much more work.) For
remembering profile type information, you will find that it's probably
easier than trying to shoe-horn in additional information on the user
object itself. For the password question/answer stuff -- you can feel
free to ignore the values if you dont intend to use them.

John


WB wrote:
Hi,

I am revamping my company's website using .Net 2.0 & C#. I would like to
implement my own custom membership provider to manage membership information
already stored in my existing SQL 2000 database.

Therefore, I need to create a class the inherits the MembershipProvider
abstract class from the System.Web.Security namespace. For instance, I need
to provide a method in this class for creating user as follows:

public override MembershipUser CreateUser(string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)

My question is, what if I have different user info fields in my database? I
don't want to use the password question and answer, but I need to store the
address, phone number of a new user. Do I just create a just dummy method
required for the implementation, and then another overload with the fields
that I need?
Thanks,
WB.

Nov 8 '05 #4

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

Similar topics

5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
2
by: Mark Olbert | last post by:
So far, I am more than a little underwhelmed by the Membership API in ASPNET2, and the ASP.NET Configuration wizard in VS2005. The latter is slow as a pig whenever it does anything. Oh well, at...
0
by: Mark Olbert | last post by:
I'm posting this here to save other folks some hair-pulling time. No need to respond. You can debug custom MembershipProvider and RoleProvider classes under the ASPNET Configuration tool by...
5
by: Ben R. | last post by:
My website uses a custome membership and role provider. I can use a custom login control and user creation control and can debug my providers while doing so with breakpoints. However, when I launch...
0
by: Mwob | last post by:
Hi all, I'm about to start creating a custom membership provider. Its for a website that already has a table of users in a single table, so I need to create a custom MP to talk to the data in...
5
by: Alias | last post by:
Hi - I'm trying to implement a custom RoleProvider based on the SqlRoleProvider. I keep receiving a an error that it can't load type 'MyRoleTest.MyRoleProvider' when trying to load my...
8
by: Tomasz | last post by:
Hello Developers! I have an interesting problem using my custom MembershipProvider, RoleProvider and Forms Authentication. Both MembershipProvider and RoleProvider require session state, where...
4
by: freeflytim | last post by:
I'm trying to implement a custom MembershipProvider (and RoleProvider) together with a custom MembershipUser class in C#, Asp.Net 2.0, MS Visual Studio 2005. Everything has worked fine so far,...
2
by: StinkyDuck | last post by:
Hello, I am relatively new to ASP.NET 2.0 and have been reading a book and going through some articles on the internet. When looking for information regarding membership and roles, I see lots...
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: 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
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
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,...
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
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,...
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
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.