删除代码:
sql="delete from Vote where ID="传递来的参数""
conn.Execute sql
4、关闭记录集
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
5、分页显示代码:
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 3
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<% If Recordset1.EOF And Recordset1.BOF Then %>
<div align="center">暂时没有提交信息!</div>
<% End If %>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
要显示的内容部分………
<% End If%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<p>
目前共有<%=Recordset1.RecordCount%>条记录
从第<%=(Recordset1_first)%>条到第<%=(Recordset1_last)%>条
</p>
<p>
<A HREF="<%=MM_moveFirst%>">第一页</A>
<A HREF="<%=MM_movePrev%>">前一页</A>
<A HREF="<%=MM_moveNext%>">后一页</A>
<A HREF="<%=MM_moveLast%>">最后一页</A>
</p>
6、包含文件代码:
通过包含文件可以方便的对网页进行管理操作:
<!--#include file="文件路径" -->
7、空格输出问题的解决
在<head></head>中加入代码:
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoWhiteSpace(str)
DoWhiteSpace = Replace((Replace(str, vbCrlf, "<br>")), chr(32)&chr(32)," ")
End Function
</SCRIPT>
然后在要输出的地方加入代码:
<%=DoWhiteSpace(Server.HTMLEncode(要输出的变量)%>
8、转到详细页面:
<%
Dim MM_paramNam,MM_keepNone,MM_keepURL,MM_keepFormMM_keepBoth,MM_removeList,MM_item ,MM_nextItem
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<A HREF="页面路径?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & Recordset1.Fields.Item("id").Value %>">转到详细页面的链接</A>
9、滚动字幕实现
<SCRIPT language=JavaScript>
<!--
var index = 13
text = new Array(13);
text[0] =''
text[1] ='文本内容 '
text[2] ='文本内容'
.
.
.
text[13] ='文本内容'
document.write("<marquee scrollAmount='1' scrollDelay= '6' direction='up' width='158' height='168' οnmοuseοver=this.stop() οnmοuseοut=this.start()>");
for (i=0;i<index;i++){
document.write (text[i] + "<br>");
}
document.write ("</marquee>")
10、CSS样式控制:
<link rel="stylesheet" href=" css文件路径" type=text/css>
A:link{TEXT-DECORATION:none ;Color:#000000}
A:active{TEXT-DECORATION:none ;}
A:visited{TEXT-DECORATION:none ;}
A:hover{Color:#4455aa}
td{font-size:9pt}
.jianju {
letter-spacing: 2px;
line-height: 200%;
}
维护网
网络技术服务经营范围、构站网 合肥网页设计、永久使用、不限域名、互联网行业哪个适合小白入行
电子商务适合女生吗?
- 首页
- 陕西省人民政府官方网站
- 正文