我有一个按钮,单击时设置会话变量。但是出于某种原因,我必须单击它两次才能真正进行保存。有没有办法解决?
谢谢
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If CInt(Session("save")) <> 1 Then
'save something ...
End If
End Sub
Private Sub btnSave_Click(sender As Object, e As System.EventArgs) Handles btnSave.Click
Session("save") = 1
End Sub