打印本文 打印本文 关闭窗口 关闭窗口
在ASP 中实现ASP.Net 的DataGrid 功能(转载)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3464  更新时间:2009/4/23 10:47:15  文章录入:mintao  责任编辑:mintao
lt;> Empty then
            DataSource.PageSize = PageSize
        else
            DataSource.PageSize = DataSource.RecordCount
        end if
        
        if CurPage = Empty then
            CurPage = 1
        end if
        
        if CurPage < 1 then
            DataSource.AbsolutePage = 1
        end if
        
         if CurPage >= DataSource.PageCount then
            DataSource.AbsolutePage = DataSource.PageCount
        end if
        
        if CurPage >= 1 and CurPage <= DataSource.PageCount then
            DataSource.AbsolutePage = CurPage
        end if

        for curRow = 1 to DataSource.PageSize
            if DataSource.EOF then
                Exit For
            end if
                        
            Response.Write("<tr>")
            for Each clm in Columns.Keys()
                if Alternate = 0 then
                    tbStyle = NormalStyle & " " & ItemStyle(clm)
                else
                    if curRow mod 2 = 0 then
                        tbStyle = AlternateStyle & " " & ItemStyle(clm)
                    else
                        tbStyle = NormalStyle & " " & ItemStyle(clm)
                    end if
                end if
                
                tdStart = "<td " & tbStyle & ">"
                tdEnd = "</td>"
                
                if Templates(clm) = Empty then
                    tbContent = DataSource(clm)
                else
                    tbContent = Templates(clm)
                    Set regEx = New RegExp
                    regEx.Pattern= "{[A-Za-z0-9_-]+}"
                    regEx.IgnoreCase = True
                    regEx.Global = True
                    Set Matches=regEx.Execute(Templates(clm))
                    For each match in match

上一页  [1] [2] [3] [4]  下一页

打印本文 打印本文 关闭窗口 关闭窗口