<%@ Page Language="VB"  Debug="true" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<Script Language="VB" Runat="Server">
Dim objConn As OleDbConnection=New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source="&server.MapPath("如皋视力.Mdb"))
Sub BindList(PageNo As Integer)
Dim  objCmd As OleDbDataAdaPter=New OleDbDataAdaPter()
Dim objDS as DataSet
Dim strSQL="select * from guestbook where show='是' order by id desc"
objCmd.TableMappings.Add("Table","guestbook")
objCmd.SelectCommand=New OleDbCommand(strSQL,objConn)
objDS=New DataSet("guestbook")
objCmd.Fill (objDS)
Dim myTable As DataTable=objDS.Tables("guestbook")
Dim TotalRecord As Integer=myTable.Rows.Count
ShowTotalRecord.Text=TotalRecord
Dim TotalPage As Integer
If TotalRecord <PageSize.SelectedItem.Value Then
   TotalPage=1
 Else
    If TotalRecord Mod PageSize.SelectedItem.Value<>0 Then
	     TotalPage=TotalRecord\PageSize.SelectedItem.Value+1
     Else
	      TotalPage=TotalRecord/PageSize.SelectedItem.Value
	End If	  		   
End If
ShowTotalPage.Text=TotalPage
Dim tempTable As DataTable=myTable.Clone()
   Dim  I,J As Integer
   For I=(PageNo-1)* PageSize.SelectedItem.Value To PageNo* _
   PageSize.SelectedItem.Value-1
   IF I>myTable.Rows.Count-1 Then Exit For
   Dim newRow As DataRow=tempTable.NewRow()
     For J=0 To myTable.Columns.Count -1
	     newRow(myTable.Columns(J).ColumnName)=myTable.Rows(I).Item(J)
      Next
	 tempTable.Rows.Add(newRow)
	Next   
	  DataGrid1.DataSource=tempTable
	  DataGrid1.DataBind()
	  
   
'DataGrid1.DataSource=objDS.Tables(0).DefaultView
'DataGrid1.DataBind()
End Sub 
Sub   ShowWhatButton()
    If PageList.SelectedIndex=0 Then
	     firstButton.Visible=False
		 preButton.Visible=False
	Else
	      firstButton.Visible=True
		  preButton.Visible=True
	End If	  	 
If PageList.SelectedIndex=PageList.Items.Count-1 Then
    nextButton.Visible=False
	lastButton.Visible=False
Else
    nextButton.Visible=True
	lastButton.Visible=True
End If
End Sub
Sub PageListItem()
   Dim I As Integer
   PageList.Items.Clear()
   For I=0 To ShowTotalPage.Text-1
       PageLIst.Items.Add ("第" & I+1 & "页")
   Next
 End Sub
 Sub Page_Init(Sender As Object,e As EventArgs)
     BindList(1)
	 PageListItem()
	 ShowWhatButton()
End Sub
Sub PageList_Change(sender As OBject, e As EventArgs)
   BindList(PageList.SelectedIndex+1)
   ShowWhatButton()
 End Sub
 
 Sub PageSize_Change(sender As Object,e As EventArgs)
    PageList.SelectedIndex=0
	BindList(PageList.SelectedIndex+1)
	PageListItem()
	ShowWhatButton()
End Sub	  	 
  Sub PageChange(sender As Object,E as CommandEventArgs)
       Select Case e.CommandArgument
	      Case "firstPage"
		      PageList.SelectedIndex=0
		  Case "prePage"
		      PageList.SelectedINdex-=1
		   Case "nextPage"
		      pageList.SelectedIndex+=1
		    Case "lastPage"
			  pageList.SelectedIndex=ShowTotalPage.Text-1
			 Case "addRecord"
			  Response.Redirect("guestbookwrite1.aspx")
		End Select
		BindList(PageList.SelectedIndex+1)
		ShowWhatButton()
 End Sub			   	  	  	  
 	   	   

</Script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>南通二建集团</title>
<link href="/Templets/images/main.css" rel="stylesheet" type="text/css">

<body bgcolor="#005EBB" background="/Templets/images/bj-dian.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="68"><img src="/Templets/images/biao.gif" width="83" height="89"></td>
    <td><img src="/Templets/images/top1.gif" width="175" height="89"></td>
    <td width="512" background="/Templets/images/top2.gif"><table width="44%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="468" height="60">
              <param name="movie" value="../dvbbs/Images/banner.swf">
              <param name="quality" value="high">
              <embed src="../dvbbs/Images/banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed></object></td>
        </tr>
      </table>
      <div align="center"></div>
    </td>
  </tr>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" background="/Templets/images/A-BJ.gif">
  <tr> 
    <td width="65">&nbsp;</td>
    <td width="60"><a href="/Html/sy/index.html"><img src="/Templets/images/a1.gif" width="60" height="31" border="0"></a></td>
    <td width="76"><a href="/Html/xwzx/index.html"><img src="/Templets/images/a2.gif" width="76" height="31" border="0"></a></td>
    <td width="77"><a href="/Html/qygk/index.html"><img src="/Templets/images/A3.gif" width="77" height="31" border="0"></a></td>
    <td width="76"><a href="/Html/zzjg/index.html"><img src="/Templets/images/A4.gif" width="76" height="31" border="0"></a></td>
    <td width="75"><a href="/Html/gcyj/index.html"><img src="/Templets/images/A5.gif" width="75" height="31" border="0"></a></td>
    <td><a href="/Html/qyzy/index.html"><img src="/Templets/images/A6.gif" width="76" height="31" border="0"></a></td>
    <td width="75"><a href="/Html/zxns/index.html"><img src="/Templets/images/A8.gif" width="75" height="31" border="0"></a></td>
    <td><a href="/dvbbs/index.asp" target="_blank"><img src="/Templets/images/A9.gif" width="75" height="31" border="0"></a></td>
    <td width="32"><a href="/Html/liuyan.aspx"><img src="/Templets/images/a10.gif" width="77" height="31" border="0"></a></td>
    <td width="33"><a href="/Html/lxwm/index.html"><img src="/Templets/images/a11.gif" width="73" height="31" border="0"></a></td>
    <td width="64">&nbsp;</td>
  </tr>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td valign="top"><img src="/Templets/images/liuyan.gif" width="770" height="110"></td>
  </tr>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="158" height="500" valign="top" background="/Templets/images/left-bj.gif"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td><img src="/Templets/images/liuyan2.gif" width="157" height="67"></td>
              </tr>
              <tr> 
                <td>&nbsp; </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td valign="bottom"><img src="/Templets/images/left-di.gif" width="157" height="247"></td>
        </tr>
      </table></td>
    <td valign="top" bgcolor="#FFFFFF" class="body-bj"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td valign="top"><img src="/Templets/images/liuyan1.gif" width="568" height="25"></td>
        </tr>
      </table>
      <table width="612" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="612" valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="40">
				

<div align="center">
<Form runat="server" id="Form1">
<ASP:ImageButton runat="server" ImageUrl="addButton.gif" CommandArgument="addRecord"
OnCommand="PageChange"/>
<ASP:ImageButton   ID="firstButton" ImageUrl="firstButton.gif" 
CommandArgument="firstPage" OnCommand="PageChange" runat="server"/>
<ASP:ImageButton   ID="preButton" ImageUrl="preButton.gif" 
CommandArgument="prePage" OnCommand="PageChange" runat="server"/>
<asp:ImageButton   ID="nextButton" ImageUrl="nextButton.gif" 
CommandArgument="nextPage" OnCommand="PageChange" runat="server"/>

<ASP:ImageButton   ID="lastButton" ImageUrl="lastButton.gif" 
CommandArgument="lastPage" OnCommand="PageChange" runat="server"/>
<br>
共有<ASP:Label runat="server" ID="ShowTotalPage"/>页,
<asp:label runat="server" ID="ShowTotalRecord"/>
                      条留言, 目前位于 
                      <asp:dropdownlist runat="server" ID="PageList" AutoPostBack="true" OnSelectedIndexChanged="PageList_Change"/>,每页显示 
                      <ASP:DropDownList Runat="server" Id="PageSize" AutoPostBack="true"
OnSelectedINdexChange="PageSize_Change">
<ASP:ListItem Value="5"  Selected="True">5条</ASP:ListItem>
<ASP:ListItem Value="10"  >10条</ASP:ListItem>
<ASP:ListItem Value="15"  >15条</ASP:ListItem>
<ASP:ListItem Value="20"  >20条</ASP:ListItem>
<ASP:ListItem Value="50"  >50条</ASP:ListItem>
<ASP:ListItem Value="100"  >100条</ASP:ListItem>
</ASP:DropDownList>
                      留言 
                      <Hr width="90%">
</Center>
</Form>

  <ASP:Repeater Runat="server" Id="DataGrid1">
  <HeaderTemplate>    </HeaderTemplate>
  	  <ItemTemplate>
  <TABLE 
      style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 100%; BORDER-COLLAPSE: collapse" 
      cellSpacing=0 cellPadding=1 width=533 align=center>
	

    
    <TR> 
      <TD 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">姓名</div></TD>
      <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"><%# Container.DataItem("username")%></TD>
    </TR>
    <TR> 
      <TD 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">性别</div></TD>
          <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid">
            <%# Container.DataItem("sex")%>          </TD>
    </TR>
    <TR> 
      <TD 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">来自</div></TD>
          <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid">
            <%# Container.DataItem("address")%>          </TD>
    </TR>
    <TR> 
      <TD 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">标题</div></TD>
          <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid">
            <%# Container.DataItem("title")%>          </TD>
    </TR>
    <TR> 
      <TD rowspan="2" align="center" 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 150%" 
            align=center><IMG src="<%# Container.DataItem("picsrc")%>" align="middle"> 
            <P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 150%" 
            align=center><SPAN style="FONT-SIZE: 9pt"><FONT face=宋体><a href="<%# Container.DataItem("homepage")%>">个人主页</a></FONT></SPAN></P>
            <P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 150%" 
            align=center><SPAN style="FONT-SIZE: 9pt"><FONT face=宋体><A 
            href="mailto:<%# Container.DataItem("email")%>">电子信箱</A></FONT></SPAN></P>
            <P style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 150%" 
            align=center><SPAN style="FONT-SIZE: 9pt"><FONT 
            face=宋体>QQ:</FONT></SPAN></P></TD>
      <TD width="121" height="32" 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center"><a href="guestbookreply.aspx?id=<%# Container.DataItem("id")%>">回复</a></div></TD>
      <TD width="166" 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center"><a href="login.asp">管理</a></div></TD>
      <TD width="167" 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">
              <%# Container.DataItem("riqi")%>            </div></TD>
    </TR>
    <TR> 
          <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid">内容:
            <%# Container.DataItem("content")%>
            <br> 
        <hr width="95%" size="1" noshade>
            Re:
            <%# Container.DataItem("reply")%>
            <br> </TD>
    </TR>
    <TR> 
      <TD 
          vAlign=middle 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"> 
        <div align="center">编号</div></TD>
      <TD colspan="3" 
          vAlign=top 
          style="BORDER-RIGHT: silver 1px solid; BORDER-TOP: rgb(112,112,112) 1px solid; BORDER-LEFT: rgb(112,112,112) 1px solid; BORDER-BOTTOM: silver 1px solid"><%# Container.DataItem("id")%>&nbsp;</TD>
    </TR><br>
  </TABLE>
  	</ItemTemplate>
	<FooterTemplate> 
      <br>
    </FooterTemplate>
  </ASP:Repeater>
  <p>&nbsp;</p>
</div>				 </td>
              </tr>
            </table>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="138" height="71" background="/Templets/images/buttom-bj.gif">&nbsp;</td>
    <td height="71" background="/Templets/images/buttom-bj.gif" class="di"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="3%"><div align="center"><img src="/Templets/images/dian1.gif" width="5" height="5"></div></td>
          <td width="97%" class="di">版权所有 &copy; 江苏南通二建集团有限公司 </td>
        </tr>
        <tr> 
          <td><div align="center"><img src="/Templets/images/dian2.gif" width="5" height="5"></div></td>
          <td class="di">地址(Add)：江苏省启东市人民中路683号　 电话(Tel)：0513-3316463 　传真(Fax)：0513-3357608</td>
        </tr>
        <tr> 
          <td><div align="center"><img src="/Templets/images/dian3.gif" width="5" height="5"></div></td>
          <td class="di">E-mail：<a href="mailto:nt2j@nt2j.cn" class="neidi">nt2j@nt2j.cn</a> 
            网址：<a href="http://www.nt2j.cn" class="neidi">http://www.nt2j.cn</a></td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
</body>
</html>
 
 
 

