• Repeater


    在Repeater1中点击 点击查看详情按钮 在Reperter2中显示信息

    protected void _details(object sender,EventArgs e)
            {
                this.Panel2.Visible=true;
                HtmlAnchor a = (HtmlAnchor)sender;//取出reperter1中的a标签中的内容
               int productid=Convert.ToInt32(a.Title.ToString());//取出a标签中title上绑定的值

                 //绑定
               string sql = string.Format("select Description from Products.dbo.Products where productid='{0}'", productid);
                DataSet ds = CM.DataAccess.dataDrive.Welanerp.connProcedureExecSql(sql);
                this.Repeater2.DataSource = ds;
                this.Repeater2.DataBind();
            }

    <asp:Panel ID="Panel1" runat="server" Visible="true">
            <asp:Repeater ID="Repeater1" runat="server">
                <HeaderTemplate>
                    <table width="100%" cellspacing="1" cellpadding="0" class="underline">
                        <tr style="height: 40px" align="center">
                        <th>书名</th>
                        <th>作者</th>
                        <th>出版社</th>
                        <th>ISBN</th>
                        <th>内容简介</th>
                        <th>图书编号</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
             
      <tr align="center" style=" background-color:Green ">
                <td><%#Eval("ProductName")%></td>
                <td><%#Eval("AuthorNames")%></td>
                <td><%#Eval("ManufacturerName")%></td>
                <td><%#Eval("BarCode")%></td>
                <td><%#Eval("Description")%></td>

               //显示详情按钮  注:鼠标点击时间必须为onserverclick(按钮点击时间在后台编写 即上)
                <td><a id="Seache" href="javascript:" runat="server" title='<%#Eval("ProductID") %>' onserverclick="_details">详细信息</a></td>
                </tr>
                </ItemTemplate>

                 //隔行颜色效果

                <AlternatingItemTemplate>
                <tr align="center" style=" background-color:red">
                <td><%#Eval("ProductName")%></td>
                <td><%#Eval("AuthorNames")%></td>
                <td><%#Eval("ManufacturerName")%></td>
                <td><%#Eval("BarCode")%></td>
                <td><%#Eval("Description")%></td>
                <td><a id="Seache" href="javascript:" runat="server" title='<%#Eval("ProductID") %>' onserverclick="_details">详细信息</a></td>

               </AlternatingItemTemplate>


                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </asp:Panel>


        <asp:Panel ID="Panel2" runat="server" Visible="false">
            <asp:Repeater ID="Repeater2" runat="server">
            <HeaderTemplate>
            <table width="100%" cellspacing="1" cellpadding="0">
             <tr align="center">
             <th>描述</th>
             </tr>
            </HeaderTemplate>
            <ItemTemplate>
            <tr align="center">
            <td> <%#Eval("Description")%></td>
            </tr>
            </ItemTemplate>
            <FooterTemplate>
            </table>
            </FooterTemplate>
            </asp:Repeater>
        </asp:Panel>

  • 相关阅读:
    Recon-Erlang线上系统诊断工具
    erlang pool模块。
    深度学习Bible学习笔记:第二、三章 线性代数 概率与信息论
    LeetCode(5):最长回文子串
    LeetCode(4):两个排序数组的中位数
    LeetCode(3):无重复字符的最长子串
    LeetCode(2):Add Two Numbers 两数相加
    LeetCode(1):两数之和
    深度学习Bible学习笔记:第一章 前言
    2018年3月18日论文阅读
  • 原文地址:https://www.cnblogs.com/happygx/p/1957950.html
Copyright © 2020-2023  润新知