zoukankan      html  css  js  c++  java
  • asp.net gridview 和 repeater 模板代码示例 拓荒者

    Repeater

                        <asp:Repeater ID="rpt_Video" runat="server" OnItemCommand="rpt_Video_ItemCommand">
    <HeaderTemplate>
    <table border="0" cellspacing="1" cellpadding="1" class="TableRepeater">
    <tr class="RepeaterHeadCss">
    <th width="130px">
    字段1
    </th>
    <th width="150px">
    字段2
    </th>
    <th width="80px">
    字段3
    </th>
    <th width="80px">
    字段4
    </th>
    <th width="80px">
    字段5
    </th>
    <th width="80px">
    字段6
    </th>
    <th colspan="140">
    字段7
    </th>
    </tr>
    </HeaderTemplate>
    <ItemTemplate>
    <tr class="RepeaterItemCss">
    <td>
    <%#Eval("字段1")%>
    </td>
    <td>
    <%#Eval("字段2")%>
    </td>
    <td>
    <%#Eval("字段3")%>
    </td>
    <td>
    <%#Eval("字段4")%>
    </td>
    <td>
    <%#Eval("字段5")%>
    </td>
    <td>
    <%#Eval("字段6")%>
    </td>
    <td width="4%">
    <%#Eval("字段7")%>
    </td>
    <td width="4%">
    <%#Eval("字段7")%>
    </td>
    <td width="4%">
    <%#Eval("字段8")%>
    </td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>

    GridView

                    <asp:GridView ID="gvD_Order" runat="server" Width="100%" IsShowSingleSelectColumn="true"
    BorderStyle
    ="None" AllowPaging="true" IsShowFooterToolbar="True" IsShowHeaderToolbar="true"
    IsSinglePageDataMode
    ="False" IsDoubleClickSelectOneLine="true" PageSize="15"
    OnRowDataBound
    ="gvD_Order_RowDataBound" IsTriggerSelect="true" IsHideCheckBoxColumn="false"
    SingleSelectColumnValueFiled
    ="ID" IsAutoSetHorizontalAlign="false" OnRowCommand="gvD_Order_RowCommand">
    <Columns>
    <asp:TemplateField HeaderText="字段1">
    <ItemStyle HorizontalAlign="Center" Width="200px" />
    <ItemTemplate>
    <%#Eval("字段1")%>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="字段2">
    <ItemStyle HorizontalAlign="Center" Width="120px" />
    <ItemTemplate>
    <%#Eval("字段2")%>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="字段3">
    <ItemStyle HorizontalAlign="Center" Width="120px" />
    <ItemTemplate>
    <%#Eval("字段3")%>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="字段4">
    <ItemStyle HorizontalAlign="Right" Width="100px" />
    <ItemTemplate>
    <%#Eval("字段4", "{0:0.######}")%>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="字段5">
    <ItemStyle HorizontalAlign="Center" Width="120px" />
    <ItemTemplate>
    <%#Eval("字段5","{0:yyyy-MM-dd HH:mm:ss}")%>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="字段6">
    <ItemStyle Width="120px" HorizontalAlign="Center" />
    <ItemTemplate>
    <asp:Label ID="字段6" runat="server" />
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="操作">
    <ItemStyle HorizontalAlign="Center" Width="70px" />
    <ItemTemplate>
    <asp:LinkButton ID="lbEdit" CommandName="EditView" runat="server" CausesValidation="false"
    CommandArgument
    ='<%#Eval("ID")%>'>查看详细</asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    <HeaderStyle BackColor="White" Font-Bold="True" Font-Size="9pt" VerticalAlign="Middle"
    Wrap
    ="True" />
    <PagerStyle VerticalAlign="Top" />
    <AlternatingRowStyle VerticalAlign="Top" />
    </asp:GridView>




    2021年9月 北京、西安两地,高薪诚聘 .NET工程师,请私信联系!
    如果认为此文对您有帮助,别忘了支持一下哦!
    声明:本博客原创文字只代表本人工作中在某一时间内总结的观点或结论,与本人所在单位没有直接利益关系。转载时请在文章页面明显位置给出原文链接。
  • 相关阅读:
    spring的学习____9.spring aop的实现方式 2 :通过自定义类实现Aop
    spring的学习____8 spring_AoP的实现方式一:使用spring API实现
    Spring 的学习报错_____2.空指针异常 java.lang.NullPointerException
    Spring学习的报错____1.Type interface com.xbf.dao.UserDao is not known to the MapperRegistry.
    spring的学习7_____AoP(面向切面)概述
    Spring 的学习6_______静态代理和动态代理(AOP的底层实现原理)
    Spring的学习____5.Bean的作用域
    Spring的学习____3.spring配置文件的解析
    第四课--程序的控制结构
    第三课--文本进度条实现
  • 原文地址:https://www.cnblogs.com/youring2/p/2203340.html
Copyright © 2011-2022 走看看