页面列表的两种方法

1、在后台为rpShow绑定list,前台可直接绑定每一列的值
             <asp:Repeater ID="rpShow" runat="server">
                    <ItemTemplate>
                        <tr onmouseover="onChangeItem(this,1)" onmouseout="onChangeItem(this,2)">
                            <td align="center"><%# (Container.ItemIndex+1) %></td>
                              <td align="left">&nbsp;&nbsp;<a class="abtn2" style="cursor:pointer;" href="View.aspx?keyid=<%# Eval("Id")%>                                "  ><%# Eval("Title")%></a></td>
                            <td align="center"><%#string.Format("{0:yyyy-MM-dd HH:mm}", Eval("ReceiveDate"))%></td>
                            <td align="center" style="word-wrap:break-word;word-break:break-all">&nbsp;&nbsp;<%# Eval("FromUnit")%></td>
                             <td align="center">&nbsp;&nbsp;<%# Eval("ProcessID")%></td>
                              <td align="center">&nbsp;&nbsp;<%# Eval("ReceiveNumber")%></td>
                            <td align="center"><%# GetUserName(Eval("UserCode").ToString())%></td>
                        </tr>
                    </ItemTemplate>
              </asp:Repeater>

 


2 直接循环<tr>
            <% foreach (FileChange_RecordShow i in List)
                { %>
                 <tr onmouseover=" onChangeItem(this, 1) " onmouseout=" onChangeItem(this, 2) ">
                     <td align="center"><%= i.SOURCESYSTEMNAME%></td>
                     <td align="center"><%= i.SOURCEMODULEIDNAME%></td>                     
                     <td align="center"><%= i.FILENAME%></td>
                     <td align="center"><%= i.FILESIZE%></td>
                     <td align="center"><%= i.CHANGETIME.ToString("yyyy-MM-dd HH:mm:ss")%></td>
                 </tr>
             <% } %>
posted @ 2015-05-06 10:27  Tz__C  阅读(218)  评论(0编辑  收藏  举报