已解决问题
关于asp 的,请进。
问题补充: ==================================================
'过程名:ShowAnnounce
'作 用:显示本站公告信息
'参 数:ShowType ------显示方式,1为纵向,2为横向
' AnnounceNum ----最多显示多少条公告
'==================================================
sub ShowAnnounce(ShowType,AnnounceNum)
dim sqlAnnounce,rsAnnounce,i
if AnnounceNum>0 and AnnounceNum<=10 then
sqlAnnounce="select top " & AnnounceNum
else
sqlAnnounce="select top 10"
end if
sqlAnnounce=sqlAnnounce & " * from Announce where IsSelected=True"
sqlAnnounce=sqlAnnounce & " and (ChannelID=0 or ChannelID=" & ChannelID & ")"
sqlAnnounce=sqlAnnounce & " and (ShowType=0 or ShowType=1) order by ID Desc"
Set rsAnnounce= Server.CreateObject("ADODB.Recordset")
rsAnnounce.open sqlAnnounce,conn,1,1
if rsAnnounce.bof and rsAnnounce.eof then
AnnounceCount=0
response.write "<p> 没有通告</p>"
else
AnnounceCount=rsAnnounce.recordcount
if ShowType=1 then
do while not rsAnnounce.eof
response.Write " <a href='#' onclick=""javascript:window.open('Announce.asp?ChannelID=" & ChannelID & "&ID=" & rsAnnounce("id") &"', 'newwindow', 'height=300, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no')"" title='" & rsAnnounce("Content") & "'>" & rsAnnounce("title") & "</div><br><div align='right'>" & rsAnnounce("Author") & " <br>" & FormatDateTime(rsAnnounce("DateAndTime"),1) & "</a>"
rsAnnounce.movenext
i=i+1
if i<AnnounceCount then response.write "<hr>"
loop
else
do while not rsAnnounce.eof
response.Write " <br><br><a href='#' onclick=""javascript:window.open('Announce.asp?ChannelID=" & ChannelID & "&ID=" & rsAnnounce("id") &"', 'newwindow', 'height=300, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no')"" title='" & rsAnnounce("Content") & "' >" & rsAnnounce("title") & " [" & FormatDateTime(rsAnnounce("DateAndTime"),1) & "]</a> "
rsAnnounce.movenext
loop
end if
end if
rsAnnounce.close
set rsAnnounce=nothing
end sub
前面页面调用是 <% call ShowAnnounce(1,1) %>
但是他会显示以下
---------------------------------------------------------------
网站公告测试
admin
2006年11月16日
--------------------------------------------------------------
我想改成 只显示 “网站公告测试”这个标题```以为我页面上只留了一行空。谢谢,怎么改?
提问者:tomore 提问时间:08-10-20 20:29
其他答案 (1)
0 评论 回答时间: 1224560465
热点问题
跟此问题相关的资源
