首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

循环语句中,文本栏究竟如何定义循环名

2013-03-04 
循环语句中,文本栏究竟怎么定义循环名?index.asp%response.expires0response.cachecontrolno-cache%

循环语句中,文本栏究竟怎么定义循环名?
index.asp
<%
response.expires=0
response.cachecontrol="no-cache"
%>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("tongbao.mdb")
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from xj Order By hound DESC ",conn,3,2
%>
  <table width="1141" align="center" cellpadding="1" cellspacing="1">
  <%
do while not rs.eof
%>
<tr bordercolor="#000000" bgcolor="#FFFFFF" class="STYLE1"  cellspacing="1" cellpadding="1">
<td><%=rs("id")%></td>
<td width="427"  bgcolor='#006699'><p align="center" class="STYLE5"><font size="2">
添加图片</font> </p>
<iframe src="2_upload.asp" width="298" height="40" frameborder=0 scrolling=no> </iframe>
<input name="image" type="text" size="15"></td>/*循环时我这里的image应
该怎么定义命名?*/
  </tr>
  <%
rs.movenext
loop
%>
</table>
</center>
<%rs.close
conn.close%>
2_upload.asp

<HTML>
<BODY BGCOLOR="#666666">
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="3_upload_update.asp"> 
<INPUT TYPE="FILE" SIZE="20" NAME="FILE1"> <INPUT TYPE=SUBMIT VALUE="保存">
</FORM>
</BODY>
</HTML>

3_upload_update.asp
<%OPTION EXPLICIT%>
<%Server.ScriptTimeOut=5000%>
<!--#include FILE="upload_5xsoft.inc"-->
<body>
<%
dim upload,file,formName,formPath,iCount,filesize
set upload=new upload_5xsoft ''建立上传对象
formpath="../shujuku/images/"
for each formName in upload.objFile ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.filesize<100000000 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">请先选择你要上传的文
件! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if
if file.fileext<>"jpg" and file.fileext<>"bmp" then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">只
能上传jpg或bmp格式的图片! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if
if file.filesize>(90000000*90000000) then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">上传图片文件过大!!! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if 
next
    file.FileName=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)'重命名
     file.fileext=".bmp"
  file.SaveAs Server.mappath(formPath&file.FileName&file.Fileext)   ''保存文件
  response.write ("<a href='del_pic_wai_upload_update.asp?pic="&File.FileName&file.filEext&"'>删除图片</a>")
  response.write "<script language=javascript>parent.document.image.value='../images/"&File.FileName&file.filE
ext&"'</script>"/*循环时我这里的image应该怎么定义命名?*/
%>


在3_upload_update.asp中


response.write "<script language=javascript>parent.document.image.value='../images/"&File.FileName&file.filE
ext&"'</script>"
/*现在我这里的image应该怎么定义命名?*/
%>

asp 表格或其它元素循环命名问题
[解决办法]
<%dim k
k=1
do while not rs.eof
%>
     <table>
<tr>     
<A onClick="bbb_<%=k%>(pic130_<%=k%>,ccc_<%=k%>);" style="CURSOR: hand"><input type="button" id="pic130_<%=k%>" alt="循环语句中,文本栏究竟如何定义循环名" name="button_<%=k%>" value="修改/增加文件"></A>
<tr id="ccc_<%=k%>" style="DISPLAY: none; WIDTH: 80px; HEIGHT: 80px"><td colspan="11" bgcolor="#666666" class="STYLE1" ><iframe src="quanmaibiao1_upload_4.asp"></iframe><input type="text" name="pic4_4" value="<%=rs("pintai")%>"></td></tr> 
  </table>
    <%
k=k+1
rs.movenext
loop
%>

[解决办法]
你语法已经错了

var aaa_+i+ = false;

//var i=1
//var aaa_+i+ = false;
function bbb__+i+(sender,who)
{  
 if(window[who.id]) //////
{  
who.style.display = "none";  
window[who.id] = false; ///////
 } 
else 

  who.style.display = ""; 
window[who.id] = true;  ////////
 }     
  }
  

热点排行