Hi Thanks for your reply. Auth mode is set to forms already. The code sample shown runs on the Login control's "LoggedIn" event which is after a successful user authentication. The value of User.Identity.Name is coming through successfully as the user whom logged in.
zanzibarwinds
Posts
-
Membership.UserName Error - Security/Roles -
Asp.net 2.0 cookieless="usecookies" not workingThe cookieless attribute is a boolean, use either TRUE or FALSE
-
what is Smtpserver address..?..plz:)Smtp is the address of the hosting emasil server. It can be either in the form of: pop3.myemailserver.com or smtp.myemailserver.com
-
Membership.UserName Error - Security/RolesHi I cannot figure out why I get the error listed below with this chunk of code which is used with the ASP.NET 2 Login control. Error: ---------------------------------------------------------------- System.NullReferenceException: Object reference not set to an instance of an object. ASPUserUID = myMem.UserName; // Offendeding line Code: (This function runs when the user is authenticated) ---------------------------------------------------------------- protected void UserDetailsStore(object sender, EventArgs e) { global_functions gf = new global_functions(); string myUserName = User.Identity.Name; string ASPUserUID; MembershipUser myMem = Membership.GetUser(User.Identity.Name); ASPUserUID = myMem.UserName; } I've tried using ASPUserUID set as a Guid data type to no avail. ANy help in this regard would be greatly appreciated. John