List Info

Thread: asp 2.0 Membership.GetUser()




asp 2.0 Membership.GetUser()
user name
2006-03-08 21:48:28
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 CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

asp 2.0 Membership.GetUser()
user name
2006-03-12 11:00:55
your Code is OK but there is some error, you should check your application on Server,
(Windows 2000 or 2003 ) on XP Professional or 2000 Pro. does't gave you back the logged in user information.

 
On 3/9/06, lwhitb1 <gmail.com">leewhitbeckgmail.com> wrote:

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)
   {
 &nbsp; &nbsp;   usrUser = Membership.GetUser();

 &nbsp; &nbsp; &nbsp; if (usrUser != null)
&nbsp; &nbsp; &nbsp;  {
 &nbsp; &nbsp;   ; &nbsp;  Label1.Text = &nbsp;usrUser.UserName.ToString();
&nbsp;   ; &nbsp; }
 &nbsp; &nbsp;   else
 ; &nbsp; &nbsp; &nbsp; &nbsp;  Label1.Text = "Didn't work - getUser not working&quot;;



--
AAF
MCSE+I
CIW ASSOCIATE & PROFESSIONAL
A+
MSVB MCP
Java Devloper
Java Applet Designer
ITMCL
ACCP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

asp 2.0 Membership.GetUser()
user name
2006-03-21 14:41:40
I figured it out.. it was a setting that I didn't have set
on the
configuration. 

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )