Data pager is not beign displayed

m150

New Member
Hello guys this is my product display page.I have included Datapager control in it.All the product all displayed in the single page...but the pager control in not displayed for navigating between pagesHere is my code....Need help to fix this code\[code\] <asp:ListView runat="server" ID="listView" GroupItemCount="4"> <LayoutTemplate> <div style="width: 650px;"> <asp:PlaceHolder runat="server" ID="groupPlaceHolder" /> </div> </LayoutTemplate> <GroupTemplate> <div style="clear: both;"> <asp:PlaceHolder runat="server" ID="itemPlaceHolder" /> </div> </GroupTemplate> <ItemTemplate> <div class="productItem"> <img src='http://stackoverflow.com/questions/15584048/<%# Eval("p_location") %>' height="120" width="120" alt="Not found" /> <div> <b> <%# Eval("p_name") %></b></div> <div> Price: $<%# Eval("p_price") %></div> </div> </ItemTemplate> <ItemSeparatorTemplate> <div class="itemSeparator"> </div> </ItemSeparatorTemplate> <GroupSeparatorTemplate> <div class="groupSeparator"> </div> </GroupSeparatorTemplate> </asp:ListView> <div class="datapager"> <asp:DataPager ID="DataPager1" PageSize="8" PagedControlID="listView" runat="server"> <Fields> <asp:NextPreviousPagerField ButtonType="Button" /> </Fields> </asp:DataPager> </div>\[/code\]CodeBehind c#:\[code\] protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("ConnectionString"); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM p_detail", conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); listView.DataSource = dt; listView.DataBind(); }\[/code\]
 
Back
Top