在页面重新加载时自动触发按钮单击

时间:2015-05-19 11:06:22

标签: vb.net google-chrome firefox prefetch

我面临一个非常奇怪的问题。我在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

0 个答案:

没有答案