1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. asp分頁代碼是什么

        時間:2024-08-06 00:52:07 ASP 我要投稿
        • 相關推薦

        asp分頁代碼是什么

          ASP即Active Server Pages,是MicroSOft公司開發的服務器端腳本環境,可用來創建動態交互式網頁并建立強大的web應用程序。下面就由yjbys小編給大家介紹ASP分頁代碼。

          用這一句調用:

          <%

          call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=center>",per_page)

          %>

          <%

          Sub PageControl(iCount,pagecount,page,table_style,font_style,per_page)

          '生成上一頁下一頁鏈接

          Dim query, a, x, temp

          action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

          temp=""

          Response.Write("<table " & Table_style & ">" & vbCrLf )

          Response.Write("<form method=get document.location = '" & action & "?zid="& zid & gro_page & "&" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )

          Response.Write("<TD align=right>" & vbCrLf )

          Response.Write(font_style & vbCrLf )

          if page<=1 then

          Response.Write ("首頁 " & vbCrLf)

          Response.Write ("上頁 " & vbCrLf)

          else

          Response.Write("<A HREF=" & action & "?zid="& zid & gro_page & "&" & temp & "Page=1>首頁</A> " & vbCrLf)

          Response.Write("<A HREF=" & action & "?zid="& zid & gro_page & "&" & temp & "Page=" & (Page-1) & ">上頁</A> " & vbCrLf)

          end if

          if page>=pagecount then

          Response.Write ("下頁 " & vbCrLf)

          Response.Write ("尾頁 " & vbCrLf)

          else

          Response.Write("<A HREF=" & action & "?zid="& zid & gro_page & "&" & temp & "Page=" & (Page+1) & ">下頁</A> " & vbCrLf)

          Response.Write("<A HREF=" & action & "?zid="& zid & gro_page & "&" & temp & "Page=" & pagecount & ">尾頁</A> " & vbCrLf)

          end if

          Response.Write(" 頁次:" & page & "/" & pageCount & "頁" &  vbCrLf)

          Response.Write(" 共有" & iCount & "條/每頁"&per_page&"條" &  vbCrLf)

          Response.Write(" 轉到" & "<INPUT TYEP=TEXT SIZE=4 Maxlength=8 VALUE=" & page & ">" & "頁"  & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO )

          Response.Write("</TD>" & vbCrLf )

          Response.Write("</TR></form>" & vbCrLf )

          Response.Write("</table>" & vbCrLf )

          End Sub

          %>

          讀取數據庫代碼:

          <%

          if tab_recall_tga="1" then

          o_zid=zid

          zid=tab_recall_cd(0)

          subt_where=" where newtype='"&tab_recall_cd(1)&"'"

          end if

          i=0

          exec="select newsname,adddate,newsid,imgurl,summary from Mlist_"&zid&subt_where&" order by adddate desc"

          set rs=server.CreateObject("adodb.recordset")

          rs.open exec,conn,1,1

          if rs.eof and rs.bof then

          response.write "目前還沒有任何數據"

          else

          rs.PageSize =5 '每頁記錄條數

          iCount=rs.RecordCount '記錄總數

          iPageSize=rs.PageSize

          maxpage=rs.PageCount

          page=request("page")

          per_page=rs.PageSize

          if Not IsNumeric(page) or page="" then

          page=1

          else

          page=cint(page)

          end if

          if page<1 then

          page=1

          elseif  page>maxpage then

          page=maxpage

          end if

          rs.AbsolutePage=Page

          if page=maxpage then

          x=iCount-(maxpage-1)*iPageSize

          else

          x=iPageSize

          end if

          For i=1 To x

          if rs("newtype")=0 then

          show_type=""

          else

          show_type=""

          end if

          uimg="0"

          imgurl=trim(rs("imgurl"))

          if len(imgurl)>0 then uimg="1"

          if uimg<>"1" then  imgurl="img/no.jpg"

          %>

          <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">

          <tr>

          <td width="140" valign="top">

          <table width="162" height="90" border="0" cellpadding="0" cellspacing="1" bgcolor="C5C5C5">

          <tr>

          <td width="169" align="center" bgcolor="#FFFFFF"><img src="<%=imgurl%>" alt="<%=rs("newsname")%>" width="174" height="91" border="0"></td>

          </tr>

          </table></td>

          <td height="70" valign="top">

          <table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">

          <tr>

          <td width="88%" height="25"><strong><font color="#000000"><%=rs("newsname")%></font></strong>&nbsp;&nbsp;發布時間:<%=rs("adddate")%></td>

          <td>&nbsp;</td>

          </tr>

          <tr>

          <td height="65" valign="top"><%=rs("summary")%></td>

          <td  width="12%" align="right" valign="bottom"><a href="m_news.asp?zid=<%=zid%>&id=<%=rs("newsid")%>">詳細&gt;&gt;</a></td>

          </tr>

          </table></td>

          </tr>

          <tr>

          <td colspan="2" valign="top"><hr size="1" noshade></td>

          </tr>

          </table>

          <%    RS.MoveNext

          next

          end if

          rs.close

          set rs=nothing

          if tab_recall_tga="1" then zid=o_zid '重新恢復虛擬定向表

          %>

          插入代碼:

          exec="insert into Admin(user_id,user_pwd,lev)values('"&o_user_id&"','"&o_user_pwd&"','"&o_lev&"')"

          'response.write  exec

          conn.execute exec

          conn.close

          set conn=nothing

          更新代碼:

          rs.update

          rs.close

          set rs=nothing

          conn.close

          set conn=nothing

        【asp分頁代碼是什么】相關文章:

        asp緩存類代碼09-28

        asp獲取當前URL代碼實例10-14

        關于ASP模板類代碼參考08-29

        asp.net 組合模式的PHP代碼10-07

        HTML代碼是什么05-10

        防盜鏈接ASP函數實現代碼08-03

        關于ASP讀取IIS日志的小程序代碼08-29

        asp.net動態獲取Excel表名的代碼10-12

        asp.net 操作INI文件讀寫類實例代碼07-28

        asp.net 動態引用樣式表代碼示范06-14

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>