More in this section

Forums / Developing with Sitefinity / Currently logged on TelerikUser

Currently logged on TelerikUser

4 posts, 0 answered
  1. Guenni
    Guenni avatar
    8 posts
    Registered:
    14 Jul 2008
    09 Sep 2008
    Link to this post
    Hi,
    I have created a site where people can log on to and add a comment. You must be logged in before.
    How do i get the currently logged on Telerik user? I want to store which user created a comment. I'm using 

    this.Page.Request.LogonUserIdentity.Name

    But if the site is hosted it will return the server name everytime.

    I'll appreciate your help!

    ~Guen~

  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    09 Sep 2008
    Link to this post
    Hi Guenni,

    Try this:

    User.Identity.Name

    I believe "this.Page.Request.LogonUserIdentity.Name" refers to the user the web process is running as.  In a hosted environment, this would return a local machine user. 

    Let me know if this doesn't work.

    Gabe
    ==============
  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Sep 2008
    Link to this post
    Hi,

    You could also try to use the following:

    string user = Telerik.Security.UserManager.GetCurrentUser().Identity.Name; 

    Don't hesitate to contact us if you have other questions.
    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Guenni
    Guenni avatar
    8 posts
    Registered:
    14 Jul 2008
    10 Sep 2008
    Link to this post
    Hey thnx Gabe and Georgi!

    I used "Telerik.Security.UserManager.GetCurrentUser().Identity.Name" and it works gr8!

    Grtz
    ~Guen~
Register for webinar
4 posts, 0 answered