我在这里要做的是根据组合框中选择的选项加载图片。但是当我在页面重新加载后从组合框中选择“2011”时,所选选项再次是 2012..请帮帮我....这是我的 ASP 代码
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><
<head><title>Sinhgad Alumni</title>
<script type="text/javascript"></script>
</head>
<link rel="stylesheet" type="text/css" href="theme/gallery.css">
<body>
<%dim conn,rs,alumniyear,rs2
Response.write(alumniyear)
Set conn=Server.createObject("ADODB.Connection")
Set rs=Server.createObject("ADODB.Recordset")
Set rs2 = server.createObject("ADODB.Recordset")
conn.open="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Server.MapPath("alumni.mdb") & ""
rs.open "select * from alumni",conn
%>
<div id="maincontent">
<div class="show">
<form name="form1" method="post"action="gallery.asp">
<h2 style="font:20px SegoeUI, 'Segoe UI', arial, sans-serif;margin: 0 auto;width: 300px;">Pictures of alumni in year:
<select name="drpyear" style="margin: 0 auto;width: 150px;height: 30px;text-align: center" onChange="javascript: document.forms['form1'].submit()" >
<%while NOT rs.EOF%>
<option onclick="javascript: document.forms['form1']">
<%response.write(rs("alumniyear"))%>
</option>
<%rs.MoveNext%>
<%wend%>
</select>
</h2>
</form>
<ul id="gallery">
<%alumniyear=Request("drpyear")
rs2.open "select * from gallery where alumni='"&alumniyear&"'",conn
if rs.EOF then%>
<li><img height="200"width="200" src=<%response.write(rs2("link"))%>></li>
<%else%>
<%while NOT rs2.EOF%>
<li><img height="200"width="200" src=<%response.write(rs2("link"))%>></li>
<%rs.MoveNext
WEND
end if
conn.Close
Set conn =Nothing%>
</ul>
</div>`