码迷,mamicode.com
首页 > 其他好文 > 详细

页面列表的两种方法

时间:2015-05-06 12:30:51      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:

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>
             <% } %>

页面列表的两种方法

标签:

原文地址:http://www.cnblogs.com/zecVip/p/4481144.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!