I use ASP.NET, MVC with my own DB.I tried to implement my own membership provider because i wanted to use my DB table "users".But now i am confused:I have registration and i have Login page that works.But after i Login how other controllers and pages can know what is the current user Id is logged in?Functions that i implemented in my membership provider:\[code\]public class MyMembershipProvider : MembershipProvider { private ManagerdBEntities1 db = new ManagerdBEntities1(); // // Properties from web.config, default all to False // private string _ApplicationName; private bool _EnablePasswordReset; private bool _EnablePasswordRetrieval = false; private bool _RequiresQuestionAndAnswer = false; private bool _RequiresUniqueEmail = true; private int _MaxInvalidPasswordAttempts; private int _PasswordAttemptWindow; private int _MinRequiredPasswordLength; private int _MinRequiredNonalphanumericCharacters; private string _PasswordStrengthRegularExpression; private MembershipPasswordFormat _PasswordFormat = MembershipPasswordFormat.Hashed; private string GetConfigValue(string configValue, string defaultValue) public override void Initialize(string name, NameValueCollection config) public override string ApplicationName public override bool ChangePassword(string username, string oldPassword, string newPassword) public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer) public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status) public override MembershipUser GetUser(string username, bool userIsOnline) public override string GetUserNameByEmail(string email) public override string ResetPassword(string username, string answer) public override bool EnablePasswordResetpublic override bool EnablePasswordRetrievalpublic override int MaxInvalidPasswordAttemptspublic override int MinRequiredNonAlphanumericCharacterspublic override int MinRequiredPasswordLengthpublic override int PasswordAttemptWindowpublic override MembershipPasswordFormat PasswordFormatpublic override string PasswordStrengthRegularExpressionpublic override bool RequiresQuestionAndAnswerpublic override bool RequiresUniqueEmailpublic override bool ValidateUser(string username, string password)\[/code\]My User model:\[code\]public partial class User { private ManagerdBEntities1 db = new ManagerdBEntities1(); public MembershipUser CreateUser(string username, string password, string email) public static void SendEmailThroughGmail(string messageBody, string emailTo) public User FindUser(string username) public string GetUserNameWithEmail(string email) public MembershipUser GetUser(string username) private static string CreateSalt() public bool ValidateUser(string username, string password) private static string CreatePasswordHash(string pwd, string salt)\[/code\]**
- And this is user fields: