Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Retrieve User Logged On

Retrieve User Logged On

Scheduled Pinned Locked Moved ASP.NET
databasevisual-studiohelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Armando_Ramirez
    wrote on last edited by
    #1

    Hi im using VS 2005 and I'm trying to write the LoginName logged into my webpage to a SQL Table There is a control called LoginName but I want to copy the user into a textbox. I've tried whit the following: TextBox1.Text = LoginName.ToString() but it doesn't works¡¡¡¡. Can somebody help??? THANX

    S A 2 Replies Last reply
    0
    • A Armando_Ramirez

      Hi im using VS 2005 and I'm trying to write the LoginName logged into my webpage to a SQL Table There is a control called LoginName but I want to copy the user into a textbox. I've tried whit the following: TextBox1.Text = LoginName.ToString() but it doesn't works¡¡¡¡. Can somebody help??? THANX

      S Offline
      S Offline
      Sean89
      wrote on last edited by
      #2

      To get the name of the user that is logged on you use: User.Identity.Name.ToString();


      A 1 Reply Last reply
      0
      • S Sean89

        To get the name of the user that is logged on you use: User.Identity.Name.ToString();


        A Offline
        A Offline
        Armando_Ramirez
        wrote on last edited by
        #3

        Oh right ¡¡ thanx a lot¡¡ It is exactly what I need

        S 1 Reply Last reply
        0
        • A Armando_Ramirez

          Oh right ¡¡ thanx a lot¡¡ It is exactly what I need

          S Offline
          S Offline
          Sean89
          wrote on last edited by
          #4

          No Problem ;P


          1 Reply Last reply
          0
          • A Armando_Ramirez

            Hi im using VS 2005 and I'm trying to write the LoginName logged into my webpage to a SQL Table There is a control called LoginName but I want to copy the user into a textbox. I've tried whit the following: TextBox1.Text = LoginName.ToString() but it doesn't works¡¡¡¡. Can somebody help??? THANX

            A Offline
            A Offline
            Albert Pascual
            wrote on last edited by
            #5

            If the control is called LoginName by doing ToString will return the internal name for LoginName on the control create a public string Text { get { return(name); } } or override ToString inside the control to return the name Hope this helps Al My eMail control My Blog

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups