由於某些原因,當用戶點擊提交按鈕並重新刷新頁面時,相同的數據將再次上傳到我的SQL Server 2005數據庫。我不會發生這種事情...........爲什麼會發生這種情況?我正在使用SQL數據源!在ASP.NET頁面刷新時再次頁面上傳數據
我的代碼
Try
'See if user typed the correct code.
If Me.txtSecurity.Text = Session("Captcha") Then
If Session("NotifyMe") = "Yes" Then
SendEmailNS()
End If
RaterRate.Insert()
RaterRate.Update()
DisableItems()
lblResultNS.Text = "Thank you for leaving a comment"
LoadCompanyList()
LoadRateRecords()
txtCommentNS.Text = ""
txtSecurity.Text = ""
lblResultNS.Focus()
Else
Session("Captcha") = GenerateCAPTCHACode()
txtSecurity.Text = ""
txtSecurity.Focus()
Validator10.Validate()
End If
Catch ex As Exception
lblResultNS.Visible = True
lblResultNS.Text = ex.Message.ToString
lblResultNS.Focus()
End Try
另一種方法是重置表單值或更改表格ID – Adeel 2010-02-21 08:32:56
艾我不想重定向用戶.......... – Etienne 2010-02-21 08:41:08