Inheritance from MembershipUser class

N

Ned White

Hi All,

i can create new instance of MembershipUser class like that;
MembershipUser userA = Membership.GetUser("someusername");

But how can i build a class which is inherited from
System.Web.Security.MembershipUser class.
as follows ;

public class B2B_User : MembershipUser
{
public B2B_User(Guid userkod): base() // i am not sure here for using
base()
{

// getting extra user info from database
}
}
-----
How can i create new instance of Membership in constructor of B2B_User
class.

my purpose is using methods and properties of MembershipUser on derived (
B2B_User) class.

Can anybody help me with this?
Thanks in advance.
 
P

Peter Bromberg [C# MVP]

Probably you should consider deriving from the MembershipProvider base class,
not MembershipUser. Example snippet:

using System.Configuration.Provider;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;
using System;

namespace PAB.Web.Providers {

public sealed class SimpleSqlMembershipProvider : MembershipProvider {....
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
 

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,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top