zoukankan      html  css  js  c++  java
  • .NET4.0的listview与DataPager的结合使用时的模板编辑

    1.设置listview模板样式:

     <asp:ListView ID="ListView1" runat="server" DataSourceID="AccessDataSource1"
                GroupItemCount="2">

          

            <!--设置LayoutTemplate 模板id="groupPlaceholder" -->
            <LayoutTemplate >
            <table runat ="server" style ="width :98%; height :auto ">
            <tr runat ="server" id="groupPlaceholder" style ="width :50%; height :auto "></tr>
            </table>
            </LayoutTemplate>

            <!--设置GroupTemplate模板id="itemPlaceholder"-->

            <GroupTemplate >
            <tr runat ="server">
            <td runat ="server" id="itemPlaceholder"></td>
            </tr>
            </GroupTemplate>

            <!--设置ItemTemplate模板-->

            <ItemTemplate >
            <td runat ="server" >
            <table style="border: 1px solid #66CCFF; height: 113px; 100%">
            <tr>
                <td rowspan="3" style=" 174px; vertical-align :middle  ">
                    <img alt="截图" height="134" src="picture/Case/<%#Eval("图片") %>" width="170" /></td>
                <td><b><%#Eval ("标题") %></b>
                </td>
            </tr>
            <tr>
                <td style =" height :50%; vertical-align :top">
                 <%#Eval("备注") %>
                    &nbsp;</td>
            </tr>
            <tr>  
                <td style =" height :20%; vertical-align :middle ">
                 <a href ="<%#Eval("地址") %>"><img alt="截图" src="image/CF205953235.gif" width="50" style="border:0"/></a>
                    &nbsp;</td>
            </tr>
              </table>
           </td>
            </ItemTemplate>


            </asp:ListView>

    2.设置DataPager样式

           <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1"
                PageSize="20">
                <Fields>
                    <asp:NextPreviousPagerField ShowFirstPageButton="True"
                        RenderDisabledButtonsAsLabels="True" ShowPreviousPageButton="False" />
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField ShowLastPageButton="True"
                        ShowNextPageButton="False" />
                </Fields>
            </asp:DataPager>


    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/mane_yao/archive/2010/07/02/5708339.aspx

  • 相关阅读:
    在ASP.NET AJAX中防止用户多次提交页面
    谈谈对C#委托的理解,附代码实例
    如何用VS2005制作Web安装程序 (转)
    VS2005下BoundField的DataFormatString不起作用了?
    使用XMLHttp在页面间传送参数
    远程连接sql server 2000服务器的解决方案
    JavaScript获取元素在浏览器画布中的绝对位置
    旧神谱
    [转帖]IE经典故障写真
    希腊神话
  • 原文地址:https://www.cnblogs.com/mane/p/1829943.html
Copyright © 2011-2022 走看看