我在ASP里在A页面里有上传图片等的一些表单通过form传到B页面中,B页面是接收A页面传过来的参数
<!-- #include file="upload.inc" -->
<%
//...
Set objUpload=new upload_5xsoft
//...
title=replace(objUpload.Form("Title"),"'","''")
content=replace(objUpload.Form("content"),"'","''")
Sorting=replace(objUpload.Form("Sorting"),"'","''")
NumSorting=replace(objUpload.Form("NumSorting"),"'","''")//该文本传过来的是数字
if Sorting="" then
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & " where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
else
randomize
rndid=int(rnd*10)+1
huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & ", Sorting='" & huaSorting & "' where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
end if
//...
%>
//...
<input type="text" name="Sorting" size="10">
//...
<input type="hidden" name="NumSorting" value="<%=rSorting("maxSorting")%>">
//...
当Sorting=""时调试能通过。
当Sorting<>""(例如:Sorting=3)时调试就出错
当我把huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid改成 huaSorting=“常数”(如:huaSorting=50或者huaSorting=rndid)时就能通过,但当huaSorting=Cint(NumSorting)或者(huaSorting=NumSorting)都不能通过。各位高手帮忙看下这是什么原因啊?
到底在huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid中错在那里请指点下
谢谢了
<!-- #include file="upload.inc" -->
<%
//...
Set objUpload=new upload_5xsoft
//...
title=replace(objUpload.Form("Title"),"'","''")
content=replace(objUpload.Form("content"),"'","''")
Sorting=replace(objUpload.Form("Sorting"),"'","''")
NumSorting=replace(objUpload.Form("NumSorting"),"'","''")//该文本传过来的是数字
if Sorting="" then
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & " where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
else
randomize
rndid=int(rnd*10)+1
huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & ", Sorting='" & huaSorting & "' where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
end if
//...
%>
//...
<input type="text" name="Sorting" size="10">
//...
<input type="hidden" name="NumSorting" value="<%=rSorting("maxSorting")%>">
//...
当Sorting=""时调试能通过。
当Sorting<>""(例如:Sorting=3)时调试就出错
当我把huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid改成 huaSorting=“常数”(如:huaSorting=50或者huaSorting=rndid)时就能通过,但当huaSorting=Cint(NumSorting)或者(huaSorting=NumSorting)都不能通过。各位高手帮忙看下这是什么原因啊?
到底在huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid中错在那里请指点下
谢谢了
解决方案 »
- GridView后台动态隐藏某列
- 哪些因素可能会导致连接没关闭?如何检查没关闭的池连接?
- c#在asp.net网站上调用winform程序
- 谁知道有这样的东西吗?有关网站测速的
- 网页界面问题……
- 用DetailsView,FormViews等控件插入数据时,如何验证数据?
- 谁有能收pop邮件的JMail呀,麻烦来一下
- 不好意思, 我是新手, 帮我看看!
- 启动机子时,总是提示“找到了 PCI device” 要添加该设备的驱动。
- 在服务器端如何设置iframe的src?
- 如何实现:aspx的网页里有很多内容,访问时Page_Load里只让他输出Page_Load里Response.Write的内容,而不输出aspx的网页里的内容?
- Response.Redirect("test.aspx?no=01#&name=john)在ie7中运行只能获取一个参数!请教如何解决?
string s = "123";
int i = int.Parse(s);说的是不是这个?!┍┥CSDN竹子专享签名功能┝━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│◆如果问题解决,请结贴,谢谢! │
│◆不知道怎么结贴?请单击我。 │
│◆如有仍有其它问题,请继续顶贴。 │
│◆表跟竹子要QQ,它太烦了,LO{n+1}ONG TIME NO USE,密码都忘了,改用清爽的GOOGLE TALK! │
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
下面是我调试通过的代码,但少了几个参数。
<!-- #include file="upload.inc" -->
<%
//...
Set objUpload=new upload_5xsoft
//...
title=replace(objUpload.Form("Title"),"'","''")
content=replace(objUpload.Form("content"),"'","''")
Sorting=replace(objUpload.Form("Sorting"),"'","''")
NumSorting=replace(objUpload.Form("NumSorting"),"'","''")//该文本传过来的是数字
if Sorting="" then
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & " where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
else
randomize
rndid=int(rnd*10)+1
huaSorting=66
strSQL="update news set title='" & title & "', content='" & content & "', industrytypeid=" & objUpload.Form("TypeId") & ", Sorting='" & huaSorting & "' where newsid=" & request.QueryString("newsid")
Conn.execute(strSQL)
end if
//...
%>
//...
<input type="text" name="Sorting" size="10">
//...
<input type="hidden" name="NumSorting" value=" <%=rSorting("maxSorting")%> ">
//... 如果我把huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid改成上面加红的字段调试就能通过
也可以用val(str(NumSorting))看下.
NumSorting=replace(objUpload.Form("NumSorting"),"'","''")'该文本传过来的是数字
这里的结果和NumSorting有密切关联.
response.write NumSorting 看看你的结果是什么先.个人觉得传过来的未必是数字<%
NumSorting=replace(request("NumSorting"),"'","''")'//该文本传过来的是数字randomize
rndid=int(rnd*10)+1
huaSorting=Cint(NumSorting)-(Cint(Sorting)-1)*10+rndid
response.write huaSorting
%>