Public Partial Class Webforms_DisplaySong
    Inherits System.Web.UI.Page

    Private WithEvents theSong As New Song
    Private WithEvents theSetlist As New Setlist

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If User.Identity.Name <> "" Then
            lbSignOut.Visible = True
        End If

        Dim intSongNum As Integer = CInt(Request.QueryString("SongNumber"))
        If Not theSong.Exists(intSongNum) Then
            Response.Redirect("ResponsePages/PageNotFound.aspx")
        End If
        theSong.Item(intSongNum)
        lblSongNum.Text = intSongNum.ToString
        lblTitle.Text = theSong.Name
        lblTimesPlayed.Text = "This song has been played " + theSetlist.NumTimesPlayed(theSong.SongNumber).ToString + " times."
    End Sub

    Protected Sub lbSignOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbSignOut.Click
        System.Web.Security.FormsAuthentication.SignOut()
        lbSignOut.Visible = False
    End Sub
End Class