selectcourse1.asp

来自「《动态网页设计基础教程》,胡杰,科学出版社」· ASP 代码 · 共 87 行

ASP
87
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="adovbs.inc"-->
<!--#include file=connection.asp -->
<%
If Session("UserLevel")<>"Student" Then
	Response.Redirect "illegal.asp"
End If
Set rstCourse=Server.CreateObject("ADODB.RecordSet")
rstCourse.Open "Course",Conn,adOpenStatic,adLockReadOnly
If Request.ServerVariables("CONTENT_LENGTH")<>0 Then
If Request.Form("Submit")="我想看具体内容" Then
	Session("Courseno")=Request.Form("selCourseno")
	Response.Redirect "selectcourse1-1.asp"	
ElseIf Request.Form("Submit")="以 后 再 说" Then
	Response.Redirect "select.asp"	
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>按课程编号选课</title>
</head>
<body>
<table width="574" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="574" height="84" valign="top">
<p align="center">&nbsp;</p>
      <p align="center"><font color="#0000FF" size="7" face="华文新魏">按课程编号选课</font></p>
      </td>
  </tr>
  <tr> 
    <td height="218" valign="top"><p align="center">&nbsp;</p>
      <form name="form1" method="post" action="<% =Request.ServerVariables("SCRIPT_NAME") %>">
                
        <div align="center"> 
          <table width="84%" height="233" border="0">
            <tr> 
              <td height="62"> <div align="center"><font color="#009900" size="4" face="黑体">请 
                  选 择 课 程 号</font></div></td>
            </tr>
            <tr> 
              <td height="30"> <div align="center"> 
                  <select name="selCourseno">
                     <%
While (NOT rstCourse.EOF)
%>
            <option value="<%=(rstCourse.Fields.Item("Courseno").Value)%>" <%If (Not isNull((rstCourse_first))) Then If (CStr(rstCourse.Fields.Item("Courseno").Value) = CStr((rstCourse_first))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rstCourse.Fields.Item("Courseno").Value)%></option>
            <%
  rstCourse.MoveNext()
Wend
If (rstCourse.CursorType > 0) Then
  rstCourse.MoveFirst
Else
  rstCourse.Requery
End If
%>         </select>
                </div></td>
            </tr>
            <tr> 
              <td height="71"> 
                <div align="center"></div></td>
            </tr>
            <tr> 
              <td height="60"> <div align="center"> 
                  <input name="Submit" type="submit" id="Submit" value="我想看具体内容">
                  &nbsp;&nbsp;&nbsp;&nbsp;
				  <input name="Submit" type="submit" id="Submit" value="以 后 再 说">
                </div></td>
            </tr>
          </table>
          <pre align="left">&nbsp;</pre>
        </div>
      </form>
      </td>
  </tr>
  <tr>
    <td height="16">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
rstCourse.Close()
Set rstCourse = Nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?