Hello Friends

I made a routine that displays a GridView in the Status of the User, that is, if he is or not logged on ( "IsOnline").
GridView appears True / False.

I would like to display a word of my liking, such as "Online" / "Away".

I am using the following syntax:

If Not Page.IsPostBack Then 

GrdLogados.DataSource Membership.GetAllUsers = () 

GrdLogados.DataBind () 

End If 

LblUsuarios.Text = Membership.GetNumberOfUsersOnline

Could it be possible?


Thanks and a hug

Your code should look like.

If Not Page.IsPostBack Then 
    GrdLogados.DataSource = Membership.GetAllUsers() 
    GrdLogados.DataBind () 
End If 
LblUsuarios.Text = Membership.GetNumberOfUsersOnline ()

You need to create appropriate bound/template columns in the GridView to display user details before binding it.

Also to display "Online" / "Away" status, you need to handle it in the RowDataBound event of the GridView.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.