使用Repeater布局表单

<asp:Repeater ID="Repeater1" runat="server" >
        <HeaderTemplate>
          <table style="width:100%; text-align:left">
            <tr style="background-color:#b7b5b5; height:25px; text-align:center">
              <th style="width:4%;">
                <asp:LinkButton ID="LinkButton5" runat="server" Text="ID" OnClick="LinkButton5_Click"></asp:LinkButton></th>
              <th style="width:16%">
                名称</th>
              <th style="width:6%">
                &nbsp;图片</th>
              <th style="width:10%">
                型号</th>
               <th style="width:12%">
                是否推荐</th>
              <th style="width:8%">
                <asp:LinkButton ID="LinkButton2" runat="server" Text="排序号" OnClick="LinkButton2_Click"></asp:LinkButton></th>
               <th style="width:8%">
                <asp:LinkButton ID="LinkButton1" runat="server" Text="更新时间" OnClick="LinkButton1_Click"></asp:LinkButton></th>
              <th style="width:8%">
               <asp:LinkButton ID="LinkButton4" runat="server" Text="访问量" OnClick="LinkButton4_Click"></asp:LinkButton></th>
              <th style="width:8%">
                <asp:LinkButton ID="LinkButton3" runat="server" Text="询单量" OnClick="LinkButton3_Click"></asp:LinkButton></th>
              <th style="width:8%">
                发布状态</th>
              <th style="width:6%">
                下架</th>
              <th style="width:6%">
                详细</th>
            </tr>
        </HeaderTemplate>
        <ItemTemplate>
          <tr style="background-color:#f1f1f1" onmouseover="javascript:menu_over(this)" onmouseout="javascript:menu_out(this)">
            <td style="text-align:center">
              <asp:Label runat="server" ID="Label20" Text='<%# Eval("FProductid") %>' />
            </td>
            <td>
              &nbsp;<asp:Label runat="server" ID="Label23" Text='<%# transstring(Eval("FProName")) %>' />
            </td>
            <td style="text-align:center">
            <a id="tip" href="#">
            <img alt="" id="Img1" width="30px" height="30px" style="border:double 1pt #cccccc" src='<%# "../Product_smallImage/"+DataBinder.Eval(Container.DataItem,"FPhoto")%>'/>
                <span id="tip_info">
                <asp:Image ID="Image1" runat="server" width="240px" height="180px" ImageUrl='<%# "../Product_smallImage/"+DataBinder.Eval(Container.DataItem,"FPhoto")%>' /></span>
                </a>
            </td>
            <td>
              &nbsp;<asp:Label runat="server" ID="Label13" Text='<%# transstring1(Eval("FModel")) %>' />
            </td>
            <td style="text-align:center">
              <asp:LinkButton ID="LinkButton6" runat="server" CommandName="LinkButton6"
              CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FProductid")%>' Text='<%# Eval("FRmd") %>'></asp:LinkButton>
            </td>
            <td>
              &nbsp;<asp:Label runat="server" ID="Label15" Text='<%# Eval("FSortID") %>' />
            </td>
            <td>
              <asp:Label runat="server" ID="Label16" Text='<%# transstring2(Eval("FSendDate")) %>' />
            </td>
            <td>
              &nbsp;<asp:Label runat="server" ID="Label17" Text='<%# Eval("FQuantity") %>' />
            </td>
            <td>
              &nbsp;<asp:Label runat="server" ID="Label18" Text='<%# Eval("FSeeks") %>' />
            </td>
            <td style="text-align:center">
              <asp:LinkButton ID="delete2" runat="server" CommandName="delete2"
              CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FProductid")%>' OnClientClick="return confirm('你确定要更改该产品的发布状态吗?')">取消发布</asp:LinkButton>
            </td>
            <td style="text-align:center">
              <asp:LinkButton ID="delete1" runat="server" CommandName="delete1" Text='<%# Eval("FPcar") %>'
              CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FProductid")%>' OnClientClick="return confirm('你确定要下架该产品吗?')"></asp:LinkButton>
            </td>
            <td style="text-align:center">
           <a href='productman.aspx?FProductid=<%# DataBinder.Eval(Container.DataItem,"FProductid") %>'>
              <asp:Label runat="server" ID="Label22" Text='查看' /></a>
            </td>
          </tr>
        </ItemTemplate>
        <FooterTemplate>
          </table>
        </FooterTemplate>
      </asp:Repeater>

posted @ 2008-04-26 16:07  hongzk  阅读(645)  评论(0编辑  收藏  举报