This is the way Microsoft says use the IPrincipal to get the current logged in user.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
HttpContext.Current.User.Identity.GetUserId()
If (User.Identity.IsAuthenticated) Then
UserId.Text = User.Identity.UserId
End If
End Sub
This works very well because I can see the UserId in the textbox.
To tell you more about what I am trying to do…I am uploading a file. In the database table I want to write the currently logged User [Writing the UserID or UserName is Perfectly ok with me because both are unique. The above code gi ...
Go to the complete details ...