Hi there,
Instead of getting the name from the LoginName control, you should get it from the MembershipUser instead:
Code:
string userName = string.Empty;
MembershipUser myMembershipUser = Membership.GetUser();
if (myMembershipUser != null)
{
erName = myMembershipUser.UserName;
}
If GetUser) returns a non-null value, the variable myMembershipUser then holds the currently logged in user which has a UserName property.
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
Beginning ASP.NET 3.5 : in C# and VB,
ASP.NET 2.0 Instant Results and
Dreamweaver MX 2004
Want to be my colleague? Then check out this post.