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
CAN SOMEONE CORRECT THE FOLLOWING CODE FOR ME
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

brunda kRank #3,804 · 389 reputationPosted Apr 11, 2012, 12:13 AM EDT
with
"If Not String.IsNullOrEmpty(strUser) Then" in the above code
ravi kamboj7 reputationPosted Apr 11, 2012, 12:49 AM EDT
SenthilkumarRank #387 · 6.5K reputationPosted Apr 11, 2012, 3:21 AM EDT
There are two mistakes.
1) Null check
2) ToLongDateString - method is missing.