Simple button action

I'm using the code below to determine whether or not the page should show images or not. The button "works" sometimes, but other times it will take 2 or 3 clicks in order for the images to display.Am I missing something? \[code\] Private Sub btnViewAll_Click(sender As Object, e As System.EventArgs) Handles btnViewAll.Click If Session("fullPage") IsNot Nothing Then If CInt(Session("fullPage")) = 0 Then Session("fullPage") = 1 Else Session("fullPage") = 0 End If Else Session("fullPage") = 1 End IfEnd Sub\[/code\]I check for the session here:\[code\]Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvFolders.RowDataBound If CInt(Session("fullPage")) = 1 Then ...load images.... End IfEnd Sub\[/code\]
 
Back
Top