我面临一个非常奇怪的问题。我在button click event
中有以下代码,可以将值插入database
。
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If txtInvoiceNumber.Text.Trim = "" Or txtTransactionAmount.Text.Trim = "" Then
'Label7.Visible = True
Else
If txtFirstName.Text.Trim <> "" Then
Utilities.InsertVirtualTransactions(txtCardNumber.Text.Trim, txtTransactionAmount.Text.Trim, txtInvoiceNumber.Text.Trim, txtTerminalID.Text, ddlProduct.SelectedValue())
Label1.Visible = True
'Label7.Visible = False
dsCards = Utilities.GetVirtualResultNew(txtCardNumber.Text.Trim, txtTerminalID.Text, txtTransactionAmount.Text.Trim)
grdTransactionResult.DataSource = dsCards
grdTransactionResult.DataBind()
DisableFields()
Label1.Visible = True
btnSearch.Visible = False
RemoveFields()
btnSubmit.Enabled = False
Else
Response.Write("<script> alert('Please select Branch from'); </script>")
End If
End If
End Sub
如果用户选择Chrome's
Duplicate
右键菜单选项或Firefox's
Reload Tab
选项在另一个标签页中打开同一页面,这可以正常运行1}}
事件再次被触发并发布btnSubmit_Click
个事务。为什么会这样?浏览器如何自动触发按钮点击事件?
如果此事件与此
有关,则为duplicate
事件
Page Load