| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 482 人关注过本帖
标题:求问asp,我把类别写在了xml里面,然后新闻循环的时候类别读取xml后,这个新 ...
只看楼主 加入收藏
soso辉
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-8-29
结帖率:0
收藏
已结贴  问题点数:15 回复次数:1 
求问asp,我把类别写在了xml里面,然后新闻循环的时候类别读取xml后,这个新闻循环的分页就失效了,有人知道为什么?
循环这个<td align="center" nowrap="nowrap"><%=show_topic_link(Recordset1.Fields.Item("mwTopicID"))%></td>
以下是函数
程序代码:
Private Function show_topic_link(tID)
    Dim tName,s
    tName=Get_Topic_Name(tID)
    If tName="-" Then
    s=tName
    Else
    s="<a href=""topicList.asp?topicID="& tID &""">"& tName &"</a>"
    End If
    show_topic_link=s
End Function

Private Function list_Topic_Name()
    Dim tName,tID,num,one,data
    For i=0 To Ubound(topic_xmlArray,2)
        tID=topic_xmlArray(0,i)
        tName=topic_xmlArray(1,i)
        one="<option value="""&tID&""">"&tName&"</option>"
        data=data & one & vbcrlf
    Next
    list_Topic_Name=data
End Function



'| 取得第一个专题名称
Private Function Get_Topic_Name(nums)
    Dim tName,num
    tName="-"
    num=""&Trim(nums)
    If IsNumeric(num) Then
    For i=0 To Ubound(topic_xmlArray,2)
        If Trim(topic_xmlArray(0,i))=Trim(num) Then
            tName=topic_xmlArray(1,i)
            Exit For
        End If
    Next
    End If
    Get_Topic_Name=tName
End Function

'| 将topic分类读入到二维数据
Private Function Get_Topic_Info_To_Array(xmlPath,xmlArray)
    On Error Resume Next
    Dim xml,topic,topic_len,info,i,j,retB
    Dim one,data,topic_id,topic_name
    j=0 : retB=True
    Set xml = Server.CreateObject("Microsoft.XMLDOM")
    'xml.load Server.MapPath(topic_info_xml_path) 'xml文件路径
    xml.load xmlPath 'xml文件路径
    Set topic = xml.getElementsByTagName("TOPIC")
    topic_len = topic.length
    data=""
    If topic_len>0 Then
        For i=0 To topic_len-1
            Set info= topic.Item(i)
            topic_id = info.childNodes.item(0).text
            topic_name = info.childNodes.item(1).text
            Redim Preserve xmlArray(1,j)
            xmlArray(0,j)=""&topic_id
            xmlArray(1,j)=""&topic_name
            j=j+1
            Set info=Nothing
        Next    
    End If    
    Set topic=Nothing
    Set xml=Nothing
    If Err Then
        Err.Clear
        retB=False
    End If
    Get_Topic_Info_To_Array=retB
End Function
搜索更多相关主题的帖子: center nowrap 
2013-06-05 11:39
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:15 
LZ指的是一篇新闻有好几页的那种情况?
2013-06-06 09:40
快速回复:求问asp,我把类别写在了xml里面,然后新闻循环的时候类别读取xml后, ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017966 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved