首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Response.Redirect错误

Response.Redirect错误
EN

Stack Overflow用户
提问于 2017-10-21 13:40:48
回答 2查看 104关注 0票数 0

我有收集数据的表单页面。用户单击SUBMIT,这将转到一个"post页面“。在该页面的末尾是我正在使用的重定向代码。response.redirect( "test.asp?ChecklistID=" + ChecklistID )由于某种原因,结果如下。

/test.asp?ChecklistID=4784,%204784

为什么这个在两个身份证里还回来?我在“结果”表中只有一张记录。是'4784‘。

添加代码

代码语言:javascript
复制
<%
'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 )

%>
EN

回答 2

Stack Overflow用户

发布于 2017-10-21 21:42:27

浏览器可能会保留response.redirect的一些历史记录。尝试使用Server.Transfer。或者,如果是相同的页面,您可能不必重新添加查询字符串。

票数 0
EN

Stack Overflow用户

发布于 2017-10-24 19:05:00

解决了,我有相同的隐藏字段在那里有两次造成问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46863846

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档