我正在使用下面的代码来确定页面是否应该显示图像。该按钮有时“有效”,但有时需要单击 2 或 3 次才能显示图像。
我错过了什么吗?
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 If
End Sub
我在这里检查会话:
Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvFolders.RowDataBound
If CInt(Session("fullPage")) = 1 Then
...load images....
End If
End Sub