当前位置:编程学习 > asp >>

Datalist使用存储过程来分页

 <body>
    <form id="form1" runat="server">
    <div>
        <asp:DataList ID="DataList1" runat="server" 
            onitemcommand="DataList1_ItemCommand" 
            oncancelcommand="DataList1_CancelCommand" 
            ondeletecommand="DataList1_DeleteCommand" oneditcommand="DataList1_EditCommand" 
            onupdatecommand="DataList1_UpdateCommand" 
            onitemdatabound="DataList1_ItemDataBound">
            <EditItemTemplate>www.zzzyk.com
                <table style="width: 100%; height: 180px;">
                    <tr>
                        <td class="style4">
                            商品名:</td>
                        <td class="style2">
                            <asp:TextBox ID="txtProductName" runat="server" 
                                Text='<%# Eval("ProductName") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            规格:</td>
                        <td class="style2">
                            <asp:TextBox ID="txtProductStandard" runat="server" 
                                Text='<%# Eval("ProductStandard") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            包装率:</td>
                        <td class="style2">
                            <asp:TextBox ID="txtPackagingRatio" runat="server" 
                                Text='<%# Eval("PackagingRatio") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            商品条码:</td>
                        <td class="style2">
                            <asp:TextBox ID="txtArticleNum" runat="server" Text='<%# Eval("ArticleNum") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            价格:</td>
                        <td class="style2">
                            <asp:TextBox ID="txtPrice" runat="server" Text='<%# Eval("Price") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <asp:Button ID="btnUpdate" runat="server" CommandArgument='<%# Eval("PId") %>' 
                                CommandName="update" Height="21px" Text="更新" />
                        </td>
                        <td class="style2">
                            <asp:Button ID="btnCancel" runat="server" CommandName="cancel" Text="取消" />
                        </td>
                    </tr>
                </table>
            </EditItemTemplate>
            <ItemTemplate>
                产品名:<asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
      &nb
补充:Web开发 , ASP.Net ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,