ASP循环传值为何不可以??

zyrcjq 2008-04-05 01:42:04
为何 Request.Form("afi")=i 不相等?Request.Form("afi")没有传递值?

<%
i=1
Do While Not rs2.eof
If Request.Form("afi")=i then '这里Request.Form("afi")为什么是空的?
rs.open"select * from fenlu_kemu where id="&i&"",conn,3,3
rs("shuoming")=request("zhaiyao" & i)
rs.update
rs.close
End if
%>

<div>
<div><input class="text" type=text size=40 name=zhaiyao<%=i%> id=zhaiyao<%=i%> value="<%=rs2("shuoming")%>"></div>
<div><input class="text" type=text size=5 onchange="total_jie();" name=jiefang<%=i%> id=jiefang<%=i%> value="<%=rs2("jord")%>"></div>
<div>input class="text" type=text size=10 name=kemu<%=i%> id=kemu<%=i%> value="<%=rs2("kemu_no")%>"></div>
</div>
<div><a href="?afi=<%=i%>">改</a></div>
<%
i=i+1
rs2.movenext
Loop
%>
...全文
96 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyrcjq 2008-04-06
  • 打赏
  • 举报
回复
确实是这个原因,但解决了这个错误后还是不能进行修改处理.
hookee 2008-04-06
  • 打赏
  • 举报
回复
< ... id="zhaiyao<%=i%>" ...>

If CInt(Trim(Request.QueryString("afi")))=i then
conn.execute "update fenlu_kemu set shuoming='" & request("zhaiyao" & i) & "' where id=" & i
End If
hookee 2008-04-05
  • 打赏
  • 举报
回复
If CInt(Trim(Request.QueryString("afi")))=i then
小逗狗 2008-04-05
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hookee 的回复:]
url中的是get方式

If Request.QueryString("afi") Then
[/Quote]
完全同意!
hookee 2008-04-05
  • 打赏
  • 举报
回复
url中的是get方式

If Request.QueryString("afi") Then

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧