书签 分享 收藏 举报 版权申诉 / 20

类型基于asp网站设计的代码.docx

  • 文档编号:29296572
  • 上传时间:2023-07-22
  • 格式:DOCX
  • 页数:20
  • 大小:19.43KB

<%EndIf%>

<%While((Repeat1__numRows<>0)AND(NOTRecordset1.EOF))%>

<%IfNotRecordset1.EOFOrNotRecordset1.BOFThen%>

要显示的内容部分………

<%EndIf%>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

Recordset1.MoveNext()

Wend

%>

目前共有<%=Recordset1.RecordCount%>条记录

从第<%=(Recordset1_first)%>条到第<%=(Recordset1_last)%>条

">第一页

">前一页

">后一页

">最后一页

(6)包含文件代码:

通过包含文件可以方便的对网页进行管理操作:

--#includefile="文件路径"-->

(7)空格输出问题的解决

在中加入代码:

functionDoWhiteSpace(str)

DoWhiteSpace=Replace((Replace(str,vbCrlf,"
")),chr(32)&chr(32),"  ")

EndFunction

然后在要输出的地方加入代码:

<%=DoWhiteSpace(Server.HTMLEncode(要输出的变量)%>

(8)转到详细页面:

<%

DimMM_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&"="

EndIf

MM_keepURL=""

MM_keepForm=""

MM_keepBoth=""

MM_keepNone=""

ForEachMM_itemInRequest.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))

EndIf

Next

ForEachMM_itemInRequest.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))

EndIf

Next

MM_keepBoth=MM_keepURL&MM_keepForm

If(MM_keepBoth<>"")Then

MM_keepBoth=Right(MM_keepBoth,Len(MM_keepBoth)-1)

EndIf

If(MM_keepURL<>"")Then

MM_keepURL=Right(MM_keepURL,Len(MM_keepURL)-1)

EndIf

If(MM_keepForm<>"")Then

MM_keepForm=Right(MM_keepForm,Len(MM_keepForm)-1)

EndIf

FunctionMM_joinChar(firstItem)

If(firstItem<>"")Then

MM_joinChar="&"

Else

MM_joinChar=""

EndIf

EndFunction

%>

<%=Server.HTMLEncode(MM_keepNone)&MM_joinChar(MM_keepNone)&"id="&Recordset1.Fields.Item("id").Value%>">转到详细页面的链接

(9)滚动字幕实现

--

varindex=13

text=newArray(13);

text[0]=''

text[1]='文本内容'

text[2]='文本内容'

text[13]='文本内容'

document.write("");

for(i=0;i

document.write(text[i]+"
");

}

document.write("")

(10)CSS样式控制:

A:

link{TEXT-DECORATION:

none;Color:

#}

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%;

}

限制访问页程序:

MM_authorizedUsers="admin,member"

MM_authFailedURL="../Error2.ASP"

MM_grantAccess=false

IfSession("MM_Username")<>""Then

If(falseOrCStr(Session("MM_UserAuthorization"))="")Or_

(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1)Then

MM_grantAccess=true

EndIf

EndIf

IfNotMM_grantAccessThen

MM_qsChar="?

"

If(InStr(1,MM_authFailedURL,"?

")>=1)ThenMM_qsChar="&"

MM_referrer=Request.ServerVariables("URL")

if(Len(Request.QueryString())>0)ThenMM_referrer=MM_referrer&"?

"&Request.QueryString()

MM_authFailedURL=MM_authFailedURL&MM_qsChar&"accessdenied="&Server.URLEncode(MM_referrer)

Response.Redirect(MM_authFailedURL)

EndIf

Board.asp中的绑定记录集分页重复区域代码,其他页所用服务器行为差不多,就不列举.

DimRecordset1

DimRecordset1_numRows

SetRecordset1=Server.CreateObject("ADODB.Recordset")

Recordset1.ActiveConnection=MM_connboard_STRING

Recordset1.Source="SELECT*FROMboardORDERBY编号DESC"

Recordset1.CursorType=0

Recordset1.CursorLocation=2

Recordset1.LockType=1

Recordset1.Open()

Recordset1_numRows=0

DimRepeat1__numRows

DimRepeat1__index

Repeat1__numRows=10

Repeat1__index=0

Recordset1_numRows=Recordset1_numRows+Repeat1__numRows

 

<%

'***RecordsetStats,MoveToRecord,andGoToRecord:

declarestatsvariables

DimRecordset1_total

DimRecordset1_first

DimRecordset1_last

'settherecordcount

Recordset1_total=Recordset1.RecordCount

'setthenumberofrowsdisplayedonthispage

If(Recordset1_numRows<0)Then

Recordset1_numRows=Recordset1_total

Elseif(Recordset1_numRows=0)Then

Recordset1_numRows=1

EndIf

'setthefirstandlastdisplayedrecord

Recordset1_first=1

Recordset1_last=Recordset1_first+Recordset1_numRows-1

'ifwehavethecorrectrecordcount,checktheotherstats

If(Recordset1_total<>-1)Then

If(Recordset1_first>Recordset1_total)Then

Recordset1_first=Recordset1_total

EndIf

If(Recordset1_last>Recordset1_total)Then

Recordset1_last=Recordset1_total

EndIf

If(Recordset1_numRows>Recordset1_total)Then

Recordset1_numRows=Recordset1_total

EndIf

EndIf

%>

<%

'***RecordsetStats:

ifwedon'tknowtherecordcount,manuallycountthem

If(Recordset1_total=-1)Then

'countthetotalrecordsbyiteratingthroughtherecordset

Recordset1_total=0

While(NotRecordset1.EOF)

Recordset1_total=Recordset1_total+1

Recordset1.MoveNext

Wend

'resetthecursortothebeginning

If(Recordset1.CursorType>0)Then

Recordset1.MoveFirst

Else

Recordset1.Requery

EndIf

'setthenumberofrowsdisplayedonthispage

If(Recordset1_numRows<0OrRecordset1_numRows>Recordset1_total)Then

Recordset1_numRows=Recordset1_total

EndIf

'setthefirstandlastdisplayedrecord

Recordset1_first=1

Recordset1_last=Recordset1_first+Recordset1_numRows-1

If(Recordset1_first>Recordset1_total)Then

Recordset1_first=Recordset1_total

EndIf

If(Recordset1_last>Recordset1_total)Then

Recordset1_last=Recordset1_total

EndIf

EndIf

%>

<%

DimMM_paramName

%>

<%

'***MoveToRecordandGoToRecord:

declarevariables

SetMM_rs=Recordset1

MM_rsCount=Recordset1_total

MM_size=Recordset1_numRows

MM_uniqueCol=""

MM_paramName=""

MM_offset=0

MM_atTotal=false

MM_paramIsDefined=false

If(MM_paramName<>"")Then

MM_paramIsDefined=(Request.QueryString(MM_paramName)<>"")

EndIf

%>

<%

'***MoveToRecord:

handle'index'or'offset'parameter

if(NotMM_paramIsDefinedAndMM_rsCount<>0)then

'useindexparameterifdefined,otherwiseuseoffsetparameter

r=Request.QueryString("index")

Ifr=""Thenr=Request.QueryString("offset")

Ifr<>""ThenMM_offset=Int(r)

'ifwehavearecordcount,checkifwearepasttheendoftherecordset

If(MM_rsCount<>-1)Then

If(MM_offset>=MM_rsCountOrMM_offset=-1)Then'pastendormovelast

If((MM_rsCountModMM_size)>0)Then'lastpagenotafullrepeatregion

MM_offset=MM_rsCount-(MM_rsCountModMM_size)

Else

MM_offset=MM_rsCount-MM_size

EndIf

EndIf

EndIf

'movethecursortotheselectedrecord

i=0

While((NotMM_rs.EOF)And(i

MM_rs.MoveNext

i=i+1

Wend

If(MM_rs.EOF)ThenMM_offset=i'setMM_offsettothelastpossiblerecord

EndIf

%>

<%

'***MoveToRecord:

ifwedontknowtherecordcount,checkthedisplayrange

If(MM_rsCount=-1)Then

'walktotheendofthedisplayrangeforthispage

i=MM_offset

While(NotMM_rs.EOFAnd(MM_size<0Ori

MM_rs.MoveNext

i=i+1

Wend

'ifwewalkedofftheendoftherecordset,setMM_rsCountandMM_size

If(MM_rs.EOF)Then

MM_rsCount=i

If(MM_size<0OrMM_size>MM_rsCount)ThenMM_size=MM_rsCount

EndIf

'ifwewalkedofftheend,settheoffsetbasedonpagesize

If(MM_rs.EOFAndNotMM_paramIsDefined)Then

If(MM_offset>MM_rsCount-MM_sizeOrMM_offset=-1)Then

If((MM_rsCountModMM_size)>0)Then

MM_offset=MM_rsCount-(MM_rsCountModMM_size)

Else

MM_offset=MM_rsCount-MM_size

EndIf

EndIf

EndIf

'resetthecursortothebeginning

If(MM_rs.CursorType>0)Then

MM_rs.MoveFirst

Else

MM_rs.Requery

EndIf

'movethecursortotheselectedrecord

i=0

While(NotMM_rs.EOFAndi

MM_rs.MoveNext

i=i+1

Wend

EndIf

%>

<%

'***MoveToRecord:

updaterecordsetstats

'setthefirstandlastdisplayedrecord

Recordset1_first=MM_offset+1

Recordset1_last=MM_offset+MM_size

If(MM_rsCount<>-1)Then

If

配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
基于 asp 网站 设计 代码
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:基于asp网站设计的代码.docx
链接地址:https://www.bdocx.com/doc/29296572.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开