我有收集数据的表单页面。用户单击SUBMIT,这将转到一个"post页面“。在该页面的末尾是我正在使用的重定向代码。response.redirect( "test.asp?ChecklistID=" + ChecklistID )由于某种原因,结果如下。
/test.asp?ChecklistID=4784,%204784
为什么这个在两个身份证里还回来?我在“结果”表中只有一张记录。是'4784‘。
添加代码
<%
'Option Explicit
Dim SQLStmt, sql, RS, ChecklistID, Location, ChecklistDate, Driveup,
ConnectString, conn, objconn
Dim weeds, parking_lot, sidewalk, windows, exterior_trash, door_clean
Dim mats_clean, Notes_page1
Location = Request("Location")
ChecklistDate = Request("ChecklistDate")
Driveup = Request("Driveup")
ChecklistID = Request("ChecklistID")
weeds = Request("weeds")
parking_lot = Request("parking_lot")
sidewalk = Request("sidewalk")
windows = Request("windows")
exterior_trash = Request("exterior_trash")
door_clean = Request("door_clean")
mats_clean = Request("mats_clean")
Notes_page1 = Request("Notes_page1")
ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("../xyz/mydatabase.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
SQLStmt = "SELECT * FROM Results WHERE ChecklistID =" & ChecklistID & " ; "
Set RS = Server.CreateObject("ADODB.Recordset")
RS.open "Results", conn, 3, 3
RS.Update
RS("ChecklistDate") = ChecklistDate
RS("Driveup") = Driveup
RS("weeds") = weeds
RS("parking_lot") = parking_lot
RS("sidewalk") = sidewalk
RS("windows") = windows
RS("exterior_trash") = exterior_trash
RS("door_clean") = door_clean
RS("mats_clean") = mats_clean
RS("Notes_page1") = Notes_page1
RS.Update
RS.close
set RS = nothing
conn.close
set conn = nothing
response.redirect( "test.asp?ChecklistID=" + ChecklistID )
%>发布于 2017-10-21 21:42:27
浏览器可能会保留response.redirect的一些历史记录。尝试使用Server.Transfer。或者,如果是相同的页面,您可能不必重新添加查询字符串。
发布于 2017-10-24 19:05:00
解决了,我有相同的隐藏字段在那里有两次造成问题。
https://stackoverflow.com/questions/46863846
复制相似问题