當前位置:首頁 » 操作系統 » asp新聞發布源碼

asp新聞發布源碼

發布時間: 2025-04-23 05:39:27

A. ASP如何在首頁調用每一個欄目的新聞標題求助

<%
Function Show(id,num,lenth)
'id是取到的相應的欄目的ID值,如最新動態(類別id是1),行業新聞(類別id是2)
'num是數據條數
'lenth是長度,即顯示的標題長度
Sql="Select Top num * from 表 where id="&id
Set Rs=Server.Createobject("Adodb.Recordset")
Rs.open Sql,conn,1,1
If not Rs.bof and not Rs.eof Then
Do while not Rs.eof
Show=Show& "<a href='List.asp?id="&Rs("id")&"' target=_blank>"&left(Rs("標題"),lenth)&"</a><br/>"
Rs.movenext
Loop
Rs.close
Set Rs=nothing
End if
End Function
%>
'上面這一段你可以單獨放在Function.asp,然後在頁面<!--#include file="function.asp"-->
<%=Show(1,10,15)%> 這是在頁面調用
'1是欄目ID,10是10條記錄,15是每條的長度.

汗.我剛剛發出來才發現樓上已經發布了.那位同仁的一樣的.如果可以你可以採納他的.

熱點內容
nginx斷點上傳 發布:2025-06-18 06:08:24 瀏覽:199
怎麼緩存 發布:2025-06-18 06:03:32 瀏覽:626
android代碼卸載應用 發布:2025-06-18 05:57:21 瀏覽:376
存儲過程ifthen語句 發布:2025-06-18 05:56:02 瀏覽:38
androidstudio入門指南 發布:2025-06-18 05:50:46 瀏覽:743
華為存儲應用場景 發布:2025-06-18 05:43:01 瀏覽:248
克魯斯卡爾演算法流程圖 發布:2025-06-18 05:42:17 瀏覽:994
python讀取指定行 發布:2025-06-18 05:40:49 瀏覽:425
linux開啟apache 發布:2025-06-18 05:11:06 瀏覽:485
瀏覽器與伺服器是什麼架構 發布:2025-06-18 05:00:11 瀏覽:805