displaycustomertb.aspx

来自「用VB实现」· ASPX 代码 · 共 66 行

ASPX
66
字号
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet 
id="dsCustomer"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connSales") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connSales") %>'
CommandText='<%# "SELECT * FROM Customers" %>'
Debug="true" PageSize="10" CurrentPage='<%# IIf((Request.QueryString("dsCustomer_CurrentPage") <> Nothing), Request.QueryString("dsCustomer_CurrentPage"), 0)  %>'
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>重复数据</title>
</head>
<body>
<table width="470" border="1">
  <tr>
    <td>客户编号</td>
    <td>客户姓名</td>
    <td>电话</td>
    <td>地址</td>
  </tr>
  <asp:Repeater runat="server" DataSource='<%# dsCustomer.DefaultView %>'>
    <itemtemplate>
      <tr>
        <td><%# dsCustomer.FieldValue("CustomerID", Container) %></td>
        <td><%# dsCustomer.FieldValue("CustomerName", Container) %></td>
        <td><%# dsCustomer.FieldValue("Phone", Container) %></td>
        <td><%# dsCustomer.FieldValue("Address", Container) %></td>
      </tr>
    </itemtemplate>
  </asp:Repeater>
</table>
<table width="409" border="0">
  <tr>
    <td width="399"><table border="0" width="91%" align="center">
      <tr>
        <td width="23%" align="center"><MM:If runat="server" Expression='<%# (dsCustomer.CurrentPage <> 0) %>'>
            <ContentsTemplate> <a href="<%# Request.ServerVariables("SCRIPT_NAME") %>?dsCustomer_currentPage=0">第一页</a> </ContentsTemplate>
          </MM:If>
        </td>
        <td width="31%" align="center"><MM:If runat="server" Expression='<%# (dsCustomer.CurrentPage <> 0) %>'>
            <ContentsTemplate> <a href="<%# Request.ServerVariables("SCRIPT_NAME") %>?dsCustomer_currentPage=<%# Math.Max(dsCustomer.CurrentPage - 1, 0) %>">前一页</a> </ContentsTemplate>
          </MM:If>
        </td>
        <td width="23%" align="center"><MM:If runat="server" Expression='<%# (dsCustomer.CurrentPage < dsCustomer.LastPage) %>'>
            <ContentsTemplate> <a href="<%# Request.ServerVariables("SCRIPT_NAME") %>?dsCustomer_currentPage=<%# Math.Min(dsCustomer.CurrentPage + 1, dsCustomer.LastPage) %>">下一页</a> </ContentsTemplate>
          </MM:If>
        </td>
        <td width="23%" align="center"><MM:If runat="server" Expression='<%# (dsCustomer.CurrentPage < dsCustomer.LastPage) %>'>
            <ContentsTemplate> <a href="<%# Request.ServerVariables("SCRIPT_NAME") %>?dsCustomer_currentPage=<%# dsCustomer.LastPage %>">最后一页</a> </ContentsTemplate>
          </MM:If>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<p>
</p>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?