zoukankan      html  css  js  c++  java
  • Repeater绑定页面的方法

    <th>
                            序号
                        </th>
                        <th>
                            编号
                        </th>
                        <th>
                            书名
                        </th>
                        <th>
                            作者
                        </th>
                        <th>
                            类别
                        </th>
                        <th>
                            国家
                        </th>
                        <th>
                            语言
                        </th>
                        <th>
                            是否显示
                        </th>
                       
                        <th>
                            发表
                        </th>
                       
                        <th>
                            描述
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    <asp:Repeater ID="rptList" runat="server">
                        <ItemTemplate>
                            <tr onmouseover="trhover(this);" onmouseout="trout(this);">
                                <td>
                                    <input type="checkbox" name="Countryckb" value='<%#Eval("BookId") %>' />
                                </td>
                                <td>
                                    <%--绑定序号的格式--%>
                                    <%#Container.ItemIndex+1 %>
                                </td>
                                <td>
                                   <%#Eval("BookId")%>
                                </td>
                                <td>
                                    <%#Eval("BookName")%>
                                </td>
                                <td>
                                    <%#Eval("Author")%>
                                </td>
                                <td>
                                    <%#Eval("TypeName")%>
                                </td>
                                <td>
                                    <%#Eval("CountryName")%>
                                </td>

                                <td>
                                    <%#Eval("LanguageName")%>
                                </td>
                               
                                <td>
                                    <%--绑定bool类型的格式,三元表达式--%>
                                    <%#Convert.ToBoolean(Eval("IsShow"))?"显示":"隐藏"%>
                                </td>
                                <td>
                                    <%--绑定时间的格式--%>
                                    <%#string.Format("{0:yyyy-MM-dd}",Eval("PublishDate"))%>
                                </td>
                                <td>
                                    <%#Eval("Description")%>
                                </td>
                                <td>
                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#string.Format("AddBook.aspx?id={0}&name={1}",Eval("BookId"),Eval("BookName")) %>'>编辑</asp:HyperLink>
                                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#string.Format("DeleteBook.aspx?id={0}",Eval("BookId")) %>'>删除</asp:HyperLink>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>

  • 相关阅读:
    Encoding
    F Takio与Blue的人生赢家之战
    D FFF团的怒火
    C Golden gun的巧克力
    B 倒不了的塔
    A jubeat
    17230 计算轴承半径
    10686 DeathGod不知道的事情
    10688 XYM-AC之路
    10692 XYM-入门之道
  • 原文地址:https://www.cnblogs.com/evan51/p/3867000.html
Copyright © 2011-2022 走看看