Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am beginner in asp.net and i am creating a travel website.In that i am using a listview to display data from my sql server.But i want to display only two records that too without using datapager.if you can't using listview can you please advice me of any other method which produce same result(ie. display records similar to listview but only limited number of record).Below is my listview.Please Help.God Bless You.

ASP.NET
<asp:ListView ID="ListView2" runat="server"
           onselectedindexchanged="ListView2_SelectedIndexChanged">
           <LayoutTemplate >
     <table class="layout display responsive-table">
        <tr >

        </tr>
        <tbody>
           <asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
        </tbody>
     </table>
  </LayoutTemplate>

  <ItemTemplate>
     <tr>
           <td class="organisationnumber">
               <asp:Image ID="Image1" runat="server" Width="150px" ImageUrl=<%# Eval("image")%> /></td>
           <td class="organisationname">
               <asp:Label ID="Label5" runat="server" Text=<%# Eval("heading")%> Font-Bold="True"></asp:Label><br />
               <asp:Label ID="Label6" runat="server" Text=<%# Eval("description")%>></asp:Label></td>
           <td class="actions">
               <a href="?" class="edit-item" title="Edit">Click Here</a>

           </td>
       </tr>

  </ItemTemplate>
  <EmptyItemTemplate>
           <td id="Td1"  runat="server">Sorry no tour Packages Available</td>
        </EmptyItemTemplate>

  </asp:ListView>
Posted

1 solution

Hi, I think you can place the DataPager in a hidden panel or a div hidden, and you defines the number of records to display, or better using a repeater control.
 
Share this answer
 
v2
Comments
faizel s 1-Aug-14 11:15am    
Thank you god bless you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900