Hi Team,
I have the following code below where i want when someone login in to the system, his /her username is caputured and set at label. of the master page.
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim dtNow As DateTime
dtNow = Now()
lblDate.Text = dtNow.ToLongDateString
Dim strUser As String = Page.User.Identity.Name()
If Page.User.Identity.Name Then
lblLoggedIn.Text = Page.User.Identity.Name & ""
End If
End Sub
Regard
George
Loading
SenthilkumarPosted Apr 11, 2012, 7:21 AM
There are two mistakes.
1) Null check
2) ToLongDateString - method is missing.
ravi kambojPosted Apr 11, 2012, 4:49 AM
brunda kPosted Apr 11, 2012, 4:13 AM
with
"If Not String.IsNullOrEmpty(strUser) Then" in the above code