Torna al Thread
Protected Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GridView1.RowCommand
If (e.CommandName = "Select") Then
Dim oItem As GridViewRow = DirectCast(DirectCast(e.CommandSource, ImageButton).NamingContainer, GridViewRow)
Dim RowIndex As Integer = oItem.RowIndex
Dim lbid As Label = DirectCast(GridView1.Rows(RowIndex).FindControl("Label1"), Label)
Dim cod As Integer = lbid.Text
caricaprofilo(cod)
End If
End Sub