好不好再说吧,先对付用了
<%@ Page Language="vb" Debug="true" %>
<%@ Import Namespace = "System.Data"%>
<%@ Import Namespace = "System.Data.Odbc"%>
<!--#include file="inc_sub.aspx"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Dim page As String
Dim PageCount As String
Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
page = Request.QueryString("page")
If Not IsInt(page) Then
page = 1
End If
'Call show_list(page)
Using connection As New OdbcConnection(ConfigurationSettings.AppSettings("ConnectionString"))
'创建SQL语句
Dim sql = "select * from wenzhang"
Dim da As New OdbcDataAdapter(sql, connection)
'创建DataSet对象
Dim ds As New DataSet
da.Fill(ds, "wenzhang")
'创建分页类
Dim objpage As New PagedDataSource
'设置数据源
objpage.DataSource = ds.Tables("wenzhang").DefaultView
objpage.AllowPaging = True
objpage.PageSize = 3
Repeater1.DataSource = objpage
If page - 1 > objpage.PageCount Then
page = objpage.PageCount
End If
objpage.CurrentPageIndex = page - 1
PageCount = objpage.PageCount
Repeater1.DataBind()
End Using
End Sub
Sub show_PageLeader(ByVal CurrentPageIndex As Integer, ByVal PageCount As Integer)
Response.Write("当前:" & CurrentPageIndex & " 共有 " & PageCount & "页")
Dim i As Integer
Dim j As Integer
For i = 1 To PageCount
If page = i Then
Response.Write("<a href=""admin_wenzhang_list.aspx?page=" & i & """><b>" & i & "</b></a> ")
Else
Response.Write("<a href=""admin_wenzhang_list.aspx?page=" & i & """>" & i & "</a> ")
End If
Next
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="600" border="0">
<tr>
<td>管理</td>
<td>标题</td>
<td>发布时间</td>
</tr>
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<tr>
<td><a href="admin_wenzhang_edit.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>">修改</a> <a href="admin_wenzhang_edit.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>">删除</a></td>
<td><%#DataBinder.Eval(Container.DataItem, "biaoti")%> </td>
<td><%#DataBinder.Eval(Container.DataItem, "fabushijian","{0:d}")%> </td>
</tr>
</ItemTemplate>
</asp:Repeater>
<tr>
<td> </td>
<td><%show_PageLeader(page, PageCount)%> </td>
<td> </td>
</tr>
</table>
<p> </p>
</div>
</form>
</body>
</html>