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. General Programming
  3. C#
  4. Logged User

Logged User

Scheduled Pinned Locked Moved C#
csharpasp-nethelptutorialquestion
2 Posts 2 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
    Amir Jalaly
    wrote on last edited by
    #1

    I write a asp.net program and need to know which user is now logged in clients . for example if user "A" is logged button B must enabled And if User "B" is logged button B must disabled in my webform . Can anyone help me ? Regards' Amir jalaly

    M 1 Reply Last reply
    0
    • A Amir Jalaly

      I write a asp.net program and need to know which user is now logged in clients . for example if user "A" is logged button B must enabled And if User "B" is logged button B must disabled in my webform . Can anyone help me ? Regards' Amir jalaly

      M Offline
      M Offline
      matthias s 0
      wrote on last edited by
      #2

      Each Page has got a User attached to it, so you might want to go writing something like in your Page_Load Eventhandler:

      if(User.Identity.IsAuthenticated && User.Identity.Name == "Pete") {
      Button1.Enabled = true;
      }

      What authentication model are you using?

      I love deadlines. I like the whooshing sound they make as they fly by.
      [Douglas Adams]

      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