-1
我正在將Asp經典項目轉換爲asp.net我得到了一行代碼,我堅持如何將此代碼轉換爲ASP.NET 2010。我做聯編碼在ASP.NET將Request.Form從經典ASP轉換爲ASP.NET
ASP經典
if request.form <> "" then
SQL = "UPDATE TBL_SPACES set pass_option='"&encode(request.form("pass_option"))&"' where parker_id="&encode(request.Cookies("parker")("id"))&""
'response.write(SQL)
Connection.Execute(SQL)
connection.close
set connection=nothing
response.redirect("/parker/")
end if
ASP.NET
If Not Request.Form Is Nothing Then
SQL = "UPDATE TBL_SPACES set pass_option='" & encode(Request.Form("pass_option")) & "' where parker_id=" & encode(Request.Cookies("parker").Values("id")) & ""
'response.write(SQL)
Dim Query As MySqlCommand = New MySqlCommand(SQL, connection)
rs = Query.ExecuteReader()
connection.Close()
connection = Nothing
Response.Redirect("/parker/")
End If
但是當重定向到這個頁面此事件總是火災和更新數據庫。