Security and Authentication
Set Field Values for Logged-In User

Description
Set the value of a field based on the identity of the currently logged-in user.
Variables
Record Control
Select the record control class which will contain the customization
Field Name Control
Select the field whose value needs to be set.
Applies to
RecordControl class
Code
 
''' 
''' Override the Databind() method, call the MyBase DataBind() and 
''' set the value of a field based on the identity of the currently
''' logged-in user.
''' 
Public Overrides Sub DataBind()

    ' Call myBase.DataBind()
    MyBase.DataBind()
    
    ' If the user is logged-in set the text of the control
    ' equal to the loginId
    If Not (Me.Page.CurrentSecurity.GetUserStatus() = "")  Then    
        Me.${Field Name Control}.Text = "Created by: " & Me.Page.CurrentSecurity.GetUserStatus()
    Else    
        Me.${Field Name Control}.Text = "Not Signed In"        
    End If 
End Sub

     


  Privacy Statement