我有一个按钮,我不想在我的页面加载中导致这个 if 命令。
If Page.IsPostBack Then
ViewState(2) = TreeView1.SelectedNode.ValuePath
ViewState(5) = TextBox1.Text
''Where I would like to put another if command or whatever else is possible to check if the buttong was clicked''
If ViewState(2) = ViewState(1) And ViewState(5) = ViewState(4) Then
nodecount = ViewState(3)
nodecount = nodecount + 1
ViewState(3) = nodecount
If nodecount > 0 Then
MsgBox("Please select another option or different number of data points")
End If
Else
nodecount = 0
ViewState(3) = nodecount
End If
End If
我尝试设置一个公共属性以更改是否单击按钮但 page.ispostback 被首先调用然后子调用。