在具有sqldatasource的转发器中进行分页 [英] paging in repeater having sqldatasource

查看:201
本文介绍了在具有sqldatasource的转发器中进行分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的网页中使用转发器进行分页。下面提到的代码是演示代码(只是测试)。来自谷歌的其他链接没有帮助,因为我使用sqldatasource.plz不发送任何链接follow.I想要分页的代码plz help.here是我的代码.....



< asp:SqlDataSource ID =SqlDataSource2runat =serverConnectionString = <%$ ConnectionStrings:ConnectionString2%> SelectCommand =SELECT * FROM [tbl_Products]>



和webform.aspx我有





 <   asp:Repeater     ID   =  Repeater2    runat   =  server    DataSourceID   =  SqlDataSource2 >  
< HeaderTemplate >
<% #Eval( 品牌)%>
< / HeaderTemplate >
< ; ItemTemplate >
< 表格 >
< tr >
< td >

< asp:标签 runat = 服务器 ID = lblContactName 文字 =' <% #Eval( 品牌%> ' / >
< / td >
< / tr >
< tr >
< td >
< asp:图像 ID = Image1 runat = server ImageUrl = < span class =code-keyword>〜/ images / laptops / compaq / Compaq-Presario-CQ43-307AUl.jpeg / >

< / td >
< / tr >
< / table >
< / ItemTemplate >
< / asp:Repeater >

解决方案

ConnectionStrings:ConnectionString2%>SelectCommand =SELECT * FROM [tbl_Products]> ;



和webform.aspx我有





 <   asp :Repeater     ID   =  Repeater2    runat   =  server    DataSourceID   =  SqlDataSource2 > ;  
< HeaderTemplate >
<% #Eval( 品牌%>
< < span class =code-leadattribute> / HeaderTemplate >
< ItemTemplate >
< >
< tr >
< td >

< asp:Label runat = 服务器 ID = lblContactName 文字 =' <% #Eval( 品牌%> ' / >
< / td >
< / tr >
< tr >
< td >
< asp:Image ID = Image1 runat = 服务器 ImageUrl = 〜/ images / laptops / compaq / Compaq-Presario-CQ43-307AUl.jpeg / >

< / td >
< / tr >

< / table >
< / ItemTemplate >
< / asp:Repeater >


您检查了以下文章吗?



http ://www.akamarketing.com/blog/66-repeater-paging-with-an-sqldatasource-in-aspnet.html [ ^ ]



http://msdn.microsoft.com/en-us/l ibrary / bb445504.aspx [ ^

i want a paging in my webpage which uses a repeater.the below mentioned code is the demo code(just testing).other links from google are not helping as i am using sqldatasource.plz dont send any links to follow.I want the code for paging plz help.here is my code.....

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" SelectCommand="SELECT * FROM [tbl_Products]">

and in webform.aspx i have


<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
    <HeaderTemplate>
        <%#Eval("Brand") %>
    </HeaderTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td>

                                       <asp:Label runat="server" ID="lblContactName" Text='<%#Eval("Brand") %>' />
                    </td>
                </tr>
            <tr>
                <td>
                                 <asp:Image ID="Image1" runat="server"  ImageUrl="~/images/laptops/compaq/Compaq-Presario-CQ43-307AUl.jpeg"/>

                    </td>
                </tr>
   </table>
             </ItemTemplate>
</asp:Repeater>

解决方案

ConnectionStrings:ConnectionString2 %>" SelectCommand="SELECT * FROM [tbl_Products]">

and in webform.aspx i have


<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
    <HeaderTemplate>
        <%#Eval("Brand") %>
    </HeaderTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td>

                                       <asp:Label runat="server" ID="lblContactName" Text='<%#Eval("Brand") %>' />
                    </td>
                </tr>
            <tr>
                <td>
                                 <asp:Image ID="Image1" runat="server"  ImageUrl="~/images/laptops/compaq/Compaq-Presario-CQ43-307AUl.jpeg"/>

                    </td>
                </tr>
   </table>
             </ItemTemplate>
</asp:Repeater>


Have you checked following articles?

http://www.akamarketing.com/blog/66-repeater-paging-with-an-sqldatasource-in-aspnet.html[^]

http://msdn.microsoft.com/en-us/library/bb445504.aspx[^]


这篇关于在具有sqldatasource的转发器中进行分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆