I created a Login.aspx page where I can login using the new
asp.net 2.0
Login tool. This is working fine. I checked that the user
was inserted
in the database. However, On the same page, I created a
button, and on
the code behind, I wrote the below code to capture the
logged in user.
It is returning null for the user, and I don't know why.
What I need to
do is get the currently logged in user, but I don't have
any
information about the user.
private MembershipUser usrUser;
protected void Button1_Click(object sender, EventArgs e)
{
usrUser = Membership.GetUser();
if (usrUser != null)
{
Label1.Text = usrUser.UserName.ToString();
}
else
Label1.Text = "Didn't work - getUser not
working";
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopers googlegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---
|