faqlist.asp

来自「《实例精粹ASP》中部分源代码」· ASP 代码 · 共 105 行

ASP
105
字号
<!-- #include file = "include/sysbase.asp" -->
<!-- #include file = "../include/config.asp" -->
<%
dim rsObj,strSQL
dim page, myKeyword, thisUrl, i, bShowAdd, sAddPage

	page = Request.QueryString("page")
	if (page = "" or IsEmpty(page)) then page = 1
	thisUrl = "faqList.asp?true=1"
	Session("adminOldUrl") = thisUrl&"&page = "&page
	set rsObj = Server.CreateObject("ADODB.RecordSet")
	strSQL = "SELECT * FROM faq WHERE 1 = 1"
	strSQL = strSQL&" ORDER by id desc"
	'Response.Write strSQL
	'Response.End
	rsObj.Open strSQL, conn, adOpenKeyset, adLockReadOnly 
	rsObj.pagesize = conMaxPerPage
%>
<html>
<head>
<title>常见问题</title>
<meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<link rel = "stylesheet" href = "include/main.css" type = "text/css">
<script language = Javascript>
<!--
function jumpTo(i){
if(i == 1){
	this.document.location = "<%=thisUrl%>";}
if(i == 2){
	this.document.location = "<%=thisUrl%>&page=<%=page-1%>";}
if(i == 3){
	this.document.location = "<%=thisUrl%>&page=<%=page+1%>";}
if(i == 4){
	this.document.location = "<%=thisUrl%>&page=<%=rsObj.pageCount%>";}
}

function deleteMe(i){
	if (confirm("确定删除?可是恢复不了的啊。") == 1){
		window.location = "faqDel.asp?id="+i;
	}
}
//-->
</script>
<script language = Javascript src = "../include/opennew.js"--></script>
</head>

<body  text = "#000000" leftmargin = "0" topmargin = "0">
<div align = "center"><br>
</div>
<table width = "98%" border = "1" bordercolordark = #9CC7EF bordercolorlight = #145AA0 cellspacing = "0" cellpadding = "4" align = "center">
  <tr> 
    <form method = "post" action = "newsList.asp" name = "form1">
      <td colspan = "2" bgcolor = "#4296E7"> 
        <div align = "center"><font color = "#FFFFFF">常见问题</font></div>
      </td>
    </form>
  </tr>
  <tr bgcolor = "#5EA5E6"> 
    <td width = "79%" nowrap> 
      <div align = "center"><font color = "#FFFFFF"> 新闻标题</font></div>
    </td>
    <td width = "21%" nowrap> 
      <div align = "center"><font color = "#FFFFFF">删除?</font></div>
    </td>
  </tr>
  <%
		dim rsID
		i = 1
		if not (rsObj.eof or err) then rsObj.move (page-1)*conMaxPerPage
		do while not (rsObj.eof or err) 
		rsID = rsObj("id")
%>
  <tr> 
    <td width = "79%" title = "点击查看具体信息" style = "cursor:hand" onClick = "Javascript:window.location = 'faqModify.asp?id=<%=rsObj("id")%>'"><%=rsObj("question")%>&nbsp;</td>
    <td width = "21%" title = "删除该项" style = "cursor:hand" onClick = "Javascript:deleteMe(<%=rsObj("id")%>)"> 
      <div align = "center"><font color = "#FF0000">×</font></div>
    </td>
  </tr>
  <%
		i = i+1
		if i>conMaxPerPage then exit do
		rsObj.MoveNext
		loop
%>
  <tr bgcolor = "#4296E7"> 
    <td colspan = "2"> 
    
		<% 
			bShowAdd  =  True 
			sAddPage  =  "faqAdd.asp"
		%>
		<!-- #include file = "include/pageguide.asp"-->
		<%
			rsObj.Close()
			set rsObj  =  Nothing
			CloseConn()
		%>
		    

    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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