| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1197 人关注过本帖
标题:[求助]response.write"selected"
只看楼主 加入收藏
djbad
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-8-23
收藏
 问题点数:0 回复次数:3 
[求助]response.write"selected"

<%
'------------------------
'编辑歌曲
'------------------------
sub editnews
if request("edit")<>"yes" and Request("id")<>"" then
dim sql
dim id
id=Request("id")
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from HN_down where id="&id
rs.open sql,conn,1,1
%>
<table width="650" height="278" border="0" align="center" cellpadding="3" cellspacing="1" class="a2" >
<tr>
<td height="29" align="center" valign="middle" class="a1">歌曲<span class="style1">编辑</span></td>
</tr>
<tr>
<td width="100%" height="237">
<table width="100%" height="267" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#e4e4e4" class="a2">
<form method="POST" name="add" action="?work=editnews&id=<%=id%>">
<tr class="a3">
<td width="13%" height="31" align="center">文件标题</td>
<td height="31">
<input type="text" name="title" size="50" value="<%=rs("title")%>">
*&nbsp;</td>
</tr>

<input type="hidden" name="auth" size="50" value="<%=rs("auth")%>">

<tr class="a3">
<td width="13%" height="27" align="center">文件地址</td>
<td height="27">
<input type="text" name="come" size="50" value="<%=rs("come")%>">
*</td>
</tr>
<tr class="a3">
<td width="13%" height="27" align="center">文件类别</td>
<td height="27">
<%
set rss=server.createobject("adodb.recordset")
sql="select * from HN_downcla where MidCls='' or Clid=0 order by descs ASC"
rss.open sql,conn,1,1
%>
<select name="clas">
<%do while not rss.eof%>
<option value="<%=rss("id")%>" <%if rs("class")=rss("id") then %>selected<%end if%>><%=rss("class")%></option>
<%
set rs1=server.createobject("adodb.recordset")
sql="select * from HN_downcla where MidCls<>'' and Clid="&rss("id")
rs1.open sql,conn,1,1
do while Not rs1.eof
%>
<option value="<%=rs1("id")%>" <%if rs("class")=rs1("id") then %>selected<%end if%>>├<%=rs1("MidCls")%></option>
<%
rs1.movenext
loop
rs1.close
set rs1=nothing
%>
<%
rss.movenext
loop
rss.close
set rss=nothing%>
</select></td>

</tr>
<tr class="a3">
<td width="11%" height="25" align="center">服务器地址</td>
<td height="25">

<select name="song_path" size="1">

<option value="1"<%if song_path=1 Then response.write(" selected") End If%>>根路径(一)</option>
<option value="2"<%if song_path=2 Then response.write(" selected") End If%> >根路径(二)</option>
<option value="3"<%if song_path=3 Then response.write(" selected") End If%> >根路径(三)</option>
<option value="4"<%if song_path=4 Then response.write(" selected") End If%> >根路径(四)</option>
<option value="5"<%if song_path=5 Then response.write(" selected") End If%> >根路径(五)</option>


</select>
</td></tr>
<tr class="a3">
<td height="31" align="center">是否显示</td>
<td height="31"><input name="kinds" type="checkbox" value="yes" <%if rs("kinds") then%> checked <%end if%>></td>
</tr>
<tr class="a3">
<td colspan="2" align="center" valign="middle">
<INPUT TYPE="hidden" name="edit" value="yes">
<input type="submit" value="确定修改">&nbsp;<input type="button" name="Submit" onclick=history.go(-1) value="返回">
</td>
</tr></form>
</table>
</td>
</tr>
</table>
</center>
</div>
<%rs.close
set rs=nothing
else
id=Request("id")
set rs=server.createobject("adodb.recordset")
sql="select * from HN_down where id="&id
rs.open sql,conn,3,3
title=request("title")
auth=request("auth")
come=request("come")
song_path=request("song_path")
clas=request("clas")
kinds=request("kinds")
rs("title")=title
rs("auth")=auth
rs("come")=come
rs("song_path")=song_path
rs("class")=clas '更新歌曲类别
IF kinds="yes" Then
RS("kinds")=true
Else
RS("kinds")=false
End IF
rs.update
rs.close
set rs=nothing
Response.Write "<br>更新成功!<meta http-equiv=refresh content=""1;URL=?work=palynews&cla="&clas&""">"
end if
end sub
%>






---------------------------------------------------------------------------------------------------------

<select name="song_path" size="1">

<option value="1"<%if song_path=1 Then response.write(" selected") End If%>>根路径(一)</option>
<option value="2"<%if song_path=2 Then response.write(" selected") End If%> >根路径(二)</option>
<option value="3"<%if song_path=3 Then response.write(" selected") End If%> >根路径(三)</option>
<option value="4"<%if song_path=4 Then response.write(" selected") End If%> >根路径(四)</option>
<option value="5"<%if song_path=5 Then response.write(" selected") End If%> >根路径(五)</option>


</select>




这段代码为什么实现不了,但可以选择里面的东西.不知道大家看不能得懂,我想要说的,因为菜所以不能用专业的语来表达.知道的请告诉一下小弟,小弟在此谢过了!!可以通过QQ:79711219 或者邮件告诉我
直接回帖都行啊!!!!!!!!!!!!!
谁告诉我,我就管谁叫爷了....



[此贴子已经被作者于2007-8-23 0:47:00编辑过]

搜索更多相关主题的帖子: response write 
2007-08-23 00:39
ayue222
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:341
专家分:0
注 册:2007-7-25
收藏
得分:0 
你的意思是编辑是不能自动选择select项的问题吧 ?
首先你的数据库中song_path字段是文本还是数字类型的?如果是文本的就是
<option value="1"<%if rs("song_path")="1" Then response.write(" selected")%>>根路径(一)</option>
<option value="2"<%if rs("song_path")="2" Then response.write(" selected")%> >根路径(二)</option>
<option value="3"<%if rs("song_path")="3" Then response.write(" selected")%> >根路径(三)</option>
<option value="4"<%if rs("song_path")="4" Then response.write(" selected")%> >根路径(四)</option>
<option value="5"<%if rs("song_path")="5" Then response.write(" selected")%> >根路径(五)</option>
数字类型的话就是
<option value="1"<%if rs("song_path")=1 Then response.write(" selected")%>>根路径(一)</option>
<option value="2"<%if rs("song_path")=2 Then response.write(" selected")%> >根路径(二)</option>
<option value="3"<%if rs("song_path")=3" Then response.write(" selected")%> >根路径(三)</option>
<option value="4"<%if rs("song_path")=4 Then response.write(" selected")%> >根路径(四)</option>
<option value="5"<%if rs("song_path")=5 Then response.write(" selected")%> >根路径(五)</option>

或者是 dim song_path
song_path=Cint(rs("song_path"))
<option value="1" <%if song_path=1 Then response.write(" selected")%>>根路径(一)</option>
<option value="2" <%if song_path=2 Then response.write(" selected")%> >根路径(二)</option>
<option value="3" <%if song_path=3 Then response.write(" selected")%> >根路径(三)</option>
<option value="4" <%if song_path=4 Then response.write(" selected")%> >根路径(四)</option>
<option value="5" <%if song_path=5 Then response.write(" selected")%> >根路径(五)</option>
2007-08-23 08:58
djbad
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-8-23
收藏
得分:0 
谢谢楼上的朋友..问题以解决!!!!!!!!!!
2007-08-23 10:01
花花公子
Rank: 4
等 级:贵宾
威 望:10
帖 子:609
专家分:0
注 册:2007-6-7
收藏
得分:0 
晕,这么多代码的,感觉很难学

[glow=150,blue,2] 该珍惜的,好好把握;该舍去的,不再留恋; 该执著的,永不怨悔;该面对的,绝不逃避。[/glow]
2007-08-23 10:15
快速回复:[求助]response.write"selected"
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015756 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved