3 Replies - 2477 Views - Last Post: 02 September 2010 - 05:08 AM Rate Topic: -----

#1 pwtc222   User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 72
  • Joined: 02-July 10

Login Name control

Posted 31 August 2010 - 08:10 PM

Hi.
I have a project,where it will display the username of the current logged in user (loginname control) after user login.
In that project,i have own custom data which allows users to enter some information that will be stored in my custom database.
Along with the other information i also want the login name control to store the content ie the User's name, to my custom database.

Any ideas guys?
Is This A Good Question/Topic? 0
  • +

Replies To: Login Name control

#2 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1536
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Login Name control

Posted 01 September 2010 - 04:36 AM

You can't get the username from the LoginUser control. You have to use the Membership class.

MembershipUser user = Membership.GetUser();
string loggedInUserName = user.UserName;


Was This Post Helpful? 0
  • +
  • -

#3 pwtc222   User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 72
  • Joined: 02-July 10

Re: Login Name control

Posted 01 September 2010 - 05:44 PM

Ok,where do i apply this code?i'm using master page.
and how it works?
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1536
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Login Name control

Posted 02 September 2010 - 05:08 AM

You apply it anywhere where you want to get the username of the logged in user.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1